Placement optimization for virtualized graphics processing

ABSTRACT

Methods, systems, and computer-readable media for placement optimization for virtualized graphics processing are disclosed. A provider network comprises a plurality of instance locations for physical compute instances and a plurality of graphics processing unit (GPU) locations for physical GPUs. A GPU location for a physical GPU or an instance location for a physical compute instance is selected in the provider network. The GPU location or instance location is selected based at least in part on one or more placement criteria. A virtual compute instance with attached virtual GPU is provisioned. The virtual compute instance is implemented using the physical compute instance in the instance location, and the virtual GPU is implemented using the physical GPU in the GPU location. The physical GPU is accessible to the physical compute instance over a network. An application is executed using the virtual GPU on the virtual compute instance.

BACKGROUND

Many companies and other organizations operate computer networks thatinterconnect numerous computing systems to support their operations,such as with the computing systems being co-located (e.g., as part of alocal network) or instead located in multiple distinct geographicallocations (e.g., connected via one or more private or publicintermediate networks). For example, distributed systems housingsignificant numbers of interconnected computing systems have becomecommonplace. Such distributed systems may provide back-end services toservers that interact with clients. Such distributed systems may alsoinclude data centers that are operated by entities to provide computingresources to customers. Some data center operators provide networkaccess, power, and secure installation facilities for hardware owned byvarious customers, while other data center operators provide “fullservice” facilities that also include hardware resources made availablefor use by their customers. As the scale and scope of distributedsystems have increased, the tasks of provisioning, administering, andmanaging the resources have become increasingly complicated.

The advent of virtualization technologies for commodity hardware hasprovided benefits with respect to managing large-scale computingresources for many clients with diverse needs. For example,virtualization technologies may allow a single physical computing deviceto be shared among multiple users by providing each user with one ormore virtual machines hosted by the single physical computing device.Each such virtual machine may be a software simulation acting as adistinct logical computing system that provides users with the illusionthat they are the sole operators and administrators of a given hardwarecomputing resource, while also providing application isolation andsecurity among the various virtual machines. With virtualization, thesingle physical computing device can create, maintain, or delete virtualmachines in a dynamic manner.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example system environment for virtualizinggraphics processing in a provider network, according to one embodiment.

FIG. 2A illustrates further aspects of the example system environmentfor virtualizing graphics processing in a provider network, includingselection of an instance type and virtual GPU class for a virtualcompute instance with an attached virtual GPU, according to oneembodiment.

FIG. 2B illustrates further aspects of the example system environmentfor virtualizing graphics processing in a provider network, includingprovisioning of a virtual compute instance with an attached virtual GPU,according to one embodiment.

FIG. 3 illustrates the use of a virtual compute instance with a virtualGPU to generate virtual GPU output for display on a client device,according to one embodiment.

FIG. 4 illustrates an example hardware architecture for implementingvirtualized graphics processing, according to one embodiment.

FIG. 5 is a flowchart illustrating a method for virtualizing graphicsprocessing in a provider network, according to one embodiment.

FIG. 6A illustrates an example system environment forapplication-specific virtualized graphics processing, includingselection of a virtual GPU based (at least in part) on requirements foran application, according to one embodiment.

FIG. 6B illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingprovisioning of a virtual compute instance with an application-specificvirtual GPU attached, according to one embodiment.

FIG. 7A illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingselection of a plurality of virtual GPUs based (at least in part) onrequirements for a plurality of applications, according to oneembodiment.

FIG. 7B illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingprovisioning of a virtual compute instance with a plurality ofapplication-specific virtual GPUs attached, according to one embodiment.

FIG. 7C illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingprovisioning of a virtual compute instance with a plurality ofapplication-specific virtual GPUs dedicated to a single application,according to one embodiment.

FIG. 8 is a flowchart illustrating a method for providingapplication-specific virtualized graphics processing, according to oneembodiment.

FIG. 9A illustrates an example system environment for local-to-remotemigration for virtualized graphics processing, including provisioning ofa virtual compute instance with a local GPU, according to oneembodiment.

FIG. 9B illustrates further aspects of the example system environmentfor local-to-remote migration for virtualized graphics processing,including the selection and attachment of a virtual GPU to the virtualcompute instance, according to one embodiment.

FIG. 10 is a flowchart illustrating a method for local-to-remotemigration of graphics processing from a local GPU to a virtual GPU,according to one embodiment.

FIG. 11A illustrates an example system environment for scaling forvirtualized graphics processing, including a virtual compute instancewith a first virtual GPU attached, according to one embodiment.

FIG. 11B illustrates further aspects of the example system environmentfor scaling for virtualized graphics processing, including thereplacement of the first virtual GPU with a second virtual GPU for thevirtual compute instance, according to one embodiment.

FIG. 11C illustrates further aspects of the example system environmentfor scaling for virtualized graphics processing, including the additionof a second virtual GPU to the first virtual GPU for the virtual computeinstance, according to one embodiment.

FIG. 12A illustrates an example system environment for scaling forvirtualized graphics processing, including a virtual compute instancewith two virtual GPUs attached, according to one embodiment.

FIG. 12B illustrates further aspects of the example system environmentfor scaling for virtualized graphics processing, including thereplacement of the virtual GPUs with a single virtual GPU for thevirtual compute instance, according to one embodiment.

FIG. 13 is a flowchart illustrating a method for scaling for virtualizedgraphics processing, according to one embodiment.

FIG. 14 illustrates an example system environment for placementoptimization for virtualized graphics processing, including multipleinstance locations and multiple GPU locations in a provider network,according to one embodiment.

FIG. 15 illustrates further aspects of the example system environmentfor placement optimization for virtualized graphics processing,including resource provisioning with a selected instance location and aselected GPU location in a provider network, according to oneembodiment.

FIG. 16A illustrates an example of multiple instance locations andmultiple GPU locations in different racks in a provider network,according to one embodiment.

FIG. 16B illustrates an example of multiple instance locations andmultiple GPU locations in different data centers in a provider network,according to one embodiment.

FIG. 17A is a flowchart illustrating a method for placement optimizationfor virtualized graphics processing, including location selection for aphysical GPU used to implement a virtual GPU, according to oneembodiment.

FIG. 17B is a flowchart illustrating a method for placement optimizationfor virtualized graphics processing, including location selection for aphysical compute instance used to implement a virtual compute instance,according to one embodiment.

FIG. 17C is a flowchart illustrating a method for placement optimizationfor virtualized graphics processing, including location selection for aphysical GPU used to implement a virtual GPU and location selection fora physical compute instance used to implement a virtual computeinstance, according to one embodiment.

FIG. 18 illustrates an example computing device that may be used in someembodiments.

While embodiments are described herein by way of example for severalembodiments and illustrative drawings, those skilled in the art willrecognize that embodiments are not limited to the embodiments ordrawings described. It should be understood, that the drawings anddetailed description thereto are not intended to limit embodiments tothe particular form disclosed, but on the contrary, the intention is tocover all modifications, equivalents and alternatives falling within thespirit and scope as defined by the appended claims. The headings usedherein are for organizational purposes only and are not meant to be usedto limit the scope of the description or the claims. As used throughoutthis application, the word “may” is used in a permissive sense (i.e.,meaning “having the potential to”), rather than the mandatory sense(i.e., meaning “must”). Similarly, the words “include,” “including,” and“includes” mean “including, but not limited to.”

DETAILED DESCRIPTION OF EMBODIMENTS

Various embodiments of methods, systems, and computer-readable media forscaling for virtualized graphics processing are described. Using thetechniques described herein, a virtual compute instance may beprovisioned, and a first set of one or more GPU(s) may be attached tothe instance to provide graphics processing. The first set of one ormore virtual GPUs may provide a particular level of graphics processing.After a change in GPU requirements for the instance is determined, thesecond set of one or more virtual GPU(s) may be selected and attached tothe virtual compute instance to replace the graphics processing of thefirst virtual GPU(s) with a different level of graphics processing. Thesecond virtual GPU(s) may be selected based on the change in GPUrequirements. Depending upon the change in GPU requirements, such ascaling operation may migrate graphics processing for a virtual computeinstance from a less capable or smaller virtual GPU class to a morecapable or larger virtual GPU class or from a more capable or largervirtual GPU class to a less capable or smaller virtual GPU class. In oneembodiment, the migration of graphics processing may be performed based(at least in part) on user input representing a change in GPUrequirements. In one embodiment, the migration of graphics processingmay be performed based (at least in part) on detection of an increase ingraphics workload. Live migration may be performed while applicationsare being executed using the first virtual GPU(s) in a manner that doesnot require changing or relaunching the applications. Migration of thevirtual compute instance to a different physical compute instance mayalso be performed, e.g., to reduce network latency associated withvirtualized graphics processing.

Various embodiments of methods, systems, and computer-readable media forplacement optimization for virtualized graphics processing aredescribed. Using the techniques described herein, optimization ofresource placement may improve one or more metrics (e.g., related toresource usage or cost) for GPU virtualization. Physical computeinstance(s) may be used to implement virtual compute instance(s), andphysical GPU(s) may be used to implement virtual GPU(s) attached to thevirtual compute instance(s). Using techniques for placementoptimization, locations of the virtual compute instance(s) and/orvirtual GPU(s) may be selected in the provider network (from among a setof available physical compute instance(s) and/or physical GPU(s)) basedon any suitable placement criteria. The one or more placement criteriamay be based (at least in part) on metrics associated with maximizingperformance, minimizing cost, minimizing energy usage, and/or any othersuitable metrics. The placement criteria may also be associated withnetwork locality. For example, to minimize network latency and/ornetwork usage, a virtual compute instance and attached virtual GPU maybe placed in the same rack in the same data center such that networkcommunication between the underlying physical compute instance andphysical GPU may not extend beyond a top-of-rack switch or othernetworking component in the rack. If locations within the same rack arenot available, then nearby locations within the same data center may beselected for a virtual compute instance and attached virtual GPU.Placement may be optimized in this manner not only for newly provisionedresources but also for migration of a virtual compute instance and/orattached virtual GPU after their use has begun. When scaling isperformed for GPU virtualization as discussed above, the locations ofany virtual GPUs may be selected based on placement criteria, and/or thelocation of the virtual compute instance may be moved based on placementcriteria.

Various embodiments of methods, systems, and computer-readable media forapplication-specific virtualized graphics processing are described.Using the techniques described herein, a virtual compute instance may beprovisioned. The virtual compute instance may be configured to executean application. The application may be associated with graphicsrequirements. For example, an application manifest may specify arecommended graphics processing unit (GPU) class and/or size of videomemory for the application, or analysis of execution of the applicationmay determine graphics requirements for the application. A virtual GPUmay be selected for the virtual compute instance based (at least inpart) on the graphics requirements for the application. The virtual GPUmay be selected from a set of virtual GPUs (e.g., belonging to virtualGPU classes) having different capabilities for graphics processing. Thevirtual GPU may be implemented using a physical GPU that is connected tothe virtual compute instance over a network. The application may beexecuted on the virtual compute instance using the virtual GPU.Additional applications on the virtual compute instance may usedifferent application-specific virtual GPUs, and theapplication-specific virtual GPUs may vary in graphics processingcapabilities based on the varying requirements of the applications.

Various embodiments of methods, systems, and computer-readable media forlocal-to-remote migration for virtualized graphics processing aredescribed. Using the techniques described herein, a virtual computeinstance may be provisioned with a local graphics processing unit (GPU)to provide graphics processing. The local GPU may be implemented usingattached hardware or using emulation. Because the local GPU may provideonly a low level of graphics processing capability, a virtual GPU may beattached to the virtual compute instance to provide improved graphicsprocessing relative to the local GPU. The virtual GPU may be selectedfrom a set of virtual GPUs (e.g., belonging to virtual GPU classes)having different capabilities for graphics processing. The virtual GPUmay be implemented using a physical GPU that is connected to the virtualcompute instance over a network. Graphics processing for the virtualcompute instance may be migrated from the local GPU to the virtual GPU.In one embodiment, graphics processing for a particular application onthe virtual compute instance may be migrated from the local GPU to thevirtual GPU during execution of the application. In one embodiment, themigration of graphics processing may be performed based (at least inpart) on detection of an increase in graphics workload.

Virtualized Graphics Processing in a Provider Network

FIG. 1 illustrates an example system environment for virtualizinggraphics processing in a provider network, according to one embodiment.Clients of a provider network 100 may use computing devices such asclient devices 180A-180N to access an elastic graphics service 110 andother resources offered by the provider network. The client devices180A-180N may be coupled to the provider network 100 via one or morenetworks 190. The provider network 100 may provide computevirtualization 140 such that a plurality of virtual compute instances141A-141Z may be implemented using a plurality of physical computeinstances 142A-142N. The virtual compute instances 141A-141Z may also bereferred to herein as virtual machines (VMs). Similarly, the providernetwork 100 may provide GPU virtualization 150 such that a plurality ofvirtual GPUs 151A-151Z may be implemented using a plurality of physicalGPUs 152A-152N. An example hardware architecture for implementingvirtual GPUs using physical GPUs is discussed with reference to FIG. 5.The underlying physical compute instances 142A-142N may beheterogeneous, and the underlying physical GPUs 152A-152N may beheterogeneous as well. In one embodiment, the compute virtualization 140may use techniques for multi-tenancy to provision virtual computeinstances 141A-141Z that exceed the physical compute instances 142A-142Nin number. In one embodiment, the GPU virtualization 150 may usetechniques for multi-tenancy to provision virtual GPUs 151A-151Z thatexceed the physical GPUs 152A-152N in number.

The elastic graphics service 110 may offer, to clients, selection andprovisioning of virtualized compute instances with attached virtualizedGPUs. Accordingly, the elastic graphics service 110 may include aninstance type selection functionality 120 and an instance provisioningfunctionality 130. In one embodiment, the provider network 100 may offervirtual compute instances 141A-141Z with varying computational and/ormemory resources. In one embodiment, each of the virtual computeinstances 141A-141Z may correspond to one of several instance types. Aninstance type may be characterized by its computational resources (e.g.,number, type, and configuration of central processing units [CPUs] orCPU cores), memory resources (e.g., capacity, type, and configuration oflocal memory), storage resources (e.g., capacity, type, andconfiguration of locally accessible storage), network resources (e.g.,characteristics of its network interface and/or network capabilities),and/or other suitable descriptive characteristics. Using the instancetype selection functionality 120, an instance type may be selected for aclient, e.g., based (at least in part) on input from the client. Forexample, a client may choose an instance type from a predefined set ofinstance types. As another example, a client may specify the desiredresources of an instance type, and the instance type selectionfunctionality 120 may select an instance type based on such aspecification.

In one embodiment, the provider network 100 may offer virtual GPUs151A-151Z with varying graphics processing capabilities. In oneembodiment, each of the virtual GPUs 151A-151Z may correspond to one ofseveral virtual GPU classes. A virtual GPU class may be characterized byits computational resources for graphics processing, memory resourcesfor graphics processing, and/or other suitable descriptivecharacteristics. In one embodiment, the virtual GPU classes mayrepresent subdivisions of graphics processing capabilities of a physicalGPU, such as a full GPU, a half GPU, a quarter GPU, and so on. Using theinstance type selection functionality 120, a virtual GPU class may beselected for a client, e.g., based (at least in part) on input from theclient. For example, a client may choose a virtual GPU class from apredefined set of virtual GPU classes. As another example, a client mayspecify the desired resources of a virtual GPU class, and the instancetype selection functionality 120 may select a virtual GPU class based onsuch a specification.

Therefore, using the instance type selection functionality 120, clients(e.g., using client devices 180A-180N) may specify requirements forvirtual compute instances and virtual GPUs. The instance provisioningfunctionality 130 may provision virtual compute instances with attachedvirtual GPUs based on the specified requirements (including anyspecified instance types and virtual GPU classes). As used herein,provisioning a virtual compute instance generally includes reservingresources (e.g., computational and memory resources) of an underlyingphysical compute instance for the client (e.g., from a pool of availablephysical compute instances and other resources), installing or launchingrequired software (e.g., an operating system), and making the virtualcompute instance available to the client for performing tasks specifiedby the client. For a particular client, a virtual compute instance maybe provisioned of the instance type selected by or for the client, andthe virtual compute instance may be provisioned with an attached virtualGPU of the GPU class selected by or for the client. In one embodiment, avirtual GPU of substantially any virtual GPU class may be attached to avirtual compute instance of substantially any instance type.

The provider network 100 may be set up by an entity such as a company ora public sector organization to provide one or more services (such asvarious types of cloud-based computing or storage) accessible via theInternet and/or other networks to client devices 180A-180N. Providernetwork 100 may include numerous data centers hosting various resourcepools, such as collections of physical and/or virtualized computerservers, storage devices, networking equipment and the like (e.g.,implemented using computing system 3000 described below with regard toFIG. 18), needed to implement and distribute the infrastructure andservices offered by the provider network 100. In some embodiments,provider network 100 may provide computing resources, such as computevirtualization service 140 and GPU virtualization service 150; storageservices, such as a block-based storage service, key-value based datastores, or various types of database systems; and/or any other type ofnetwork-based services. Client devices 180A-180N may access thesevarious services offered by provider network 100 via network(s) 190.Likewise, network-based services may themselves communicate and/or makeuse of one another to provide different services. For example, computingresources offered to client devices 180A-180N in units called“instances,” such as virtual or physical compute instances or storageinstances, may make use of particular data volumes, providing virtualblock storage for the compute instances. The provider network 100 mayimplement or provide a multi-tenant environment such that multipleclients (e.g., using client devices 180A-180N) may access or use aparticular resource in a substantially simultaneous manner.

As noted above, compute virtualization service 140 may offer variousvirtual compute instances 141A-141Z to client devices 180A-180N. Avirtual compute instance may, for example, comprise one or more serverswith a specified computational capacity (which may be specified byindicating the type and number of CPUs, the main memory size, and so on)and a specified software stack (e.g., a particular version of anoperating system, which may in turn run on top of a hypervisor). Anumber of different types of computing devices may be used singly or incombination to implement the compute instances of the computevirtualization service 140 in different embodiments, including generalpurpose or special purpose computer servers, storage devices, networkdevices and the like. In some embodiments, client devices 180A-180N orother any other user may be configured (and/or authorized) to directnetwork traffic to a virtual compute instance. In various embodiments,virtual compute instances 141A-141Z may attach or map to one or moredata volumes provided by a storage service in order to obtain persistentstorage for performing various operations. Using the techniquesdescribed herein, virtual GPUs 151A-151Z may be attached to virtualcompute instances 141A-141Z to provide graphics processing for thevirtual compute instances.

Virtual compute instances 141A-141Z may operate or implement a varietyof different platforms, such as application server instances, Java™virtual machines (JVMs) or other virtual machines, general purpose orspecial-purpose operating systems, platforms that support variousinterpreted or compiled programming languages such as Ruby, Perl,Python, C, C++ and the like, or high-performance computing platforms)suitable for performing client applications, without for examplerequiring the client devices 180A-180N to access an instance. In someembodiments, virtual compute instances 141A-141Z may have differentinstance types or configurations based on expected uptime ratios. Theuptime ratio of a particular virtual compute instance may be defined asthe ratio of the amount of time the instance is activated to the totalamount of time for which the instance is reserved. Uptime ratios mayalso be referred to as utilizations in some implementations. If a clientexpects to use a compute instance for a relatively small fraction of thetime for which the instance is reserved (e.g., 30%-35% of a year-longreservation), the client may decide to reserve the instance as a LowUptime Ratio instance, and the client may pay a discounted hourly usagefee in accordance with the associated pricing policy. If the clientexpects to have a steady-state workload that requires an instance to beup most of the time, then the client may reserve a High Uptime Ratioinstance and potentially pay an even lower hourly usage fee, although insome embodiments the hourly fee may be charged for the entire durationof the reservation, regardless of the actual number of hours of use, inaccordance with pricing policy. An option for Medium Uptime Ratioinstances, with a corresponding pricing policy, may be supported in someembodiments as well, where the upfront costs and the per-hour costs fallbetween the corresponding High Uptime Ratio and Low Uptime Ratio costs.

Virtual compute instance configurations may also include virtual computeinstances with a general or specific purpose, such as computationalworkloads for compute intensive applications (e.g., high-traffic webapplications, ad serving, batch processing, video encoding, distributedanalytics, high-energy physics, genome analysis, and computational fluiddynamics), graphics intensive workloads (e.g., game streaming, 3Dapplication streaming, server-side graphics workloads, rendering,financial modeling, and engineering design), memory intensive workloads(e.g., high performance databases, distributed memory caches, in-memoryanalytics, genome assembly and analysis), and storage optimizedworkloads (e.g., data warehousing and cluster file systems). In someembodiments, particular instance types for virtual compute instances maybe associated with default classes for virtual GPUs. For example, someinstance types may be configured without a virtual GPU as a defaultconfiguration, while other instance types designated for graphicsintensive workloads may be designated with particular virtual GPUclasses as a default configuration. Configurations of virtual computeinstances may also include their location in a particular data center oravailability zone, geographic location, and (in the case of reservedcompute instances) reservation term length.

The client devices 180A-180N may represent or correspond to variousclients or users of the provider network 100, such as customers who seekto use services offered by the provider network. The clients, users, orcustomers may represent persons, businesses, other organizations, and/orother entities. The client devices 180A-180N may be distributed over anysuitable locations or regions. Each of the client devices 180A-180N maybe implemented using one or more computing devices, any of which may beimplemented by the example computing device 3000 illustrated in FIG. 18.

The client devices 180A-180N may encompass any type of clientconfigurable to submit requests to provider network 100. For example, agiven client device may include a suitable version of a web browser, orit may include a plug-in module or other type of code module configuredto execute as an extension to or within an execution environmentprovided by a web browser. Alternatively, a client device may encompassan application such as a database application (or user interfacethereof), a media application, an office application, or any otherapplication that may make use of virtual compute instances, storagevolumes, or other network-based services in provider network 100 toperform various operations. In some embodiments, such an application mayinclude sufficient protocol support (e.g., for a suitable version ofHypertext Transfer Protocol [HTTP]) for generating and processingnetwork-based service requests without necessarily implementing fullbrowser support for all types of network-based data. In someembodiments, client devices 180A-180N may be configured to generatenetwork-based service requests according to a Representational StateTransfer (REST)-style network-based services architecture, a document-or message-based network-based services architecture, or anothersuitable network-based services architecture. In some embodiments,client devices 180A-180N (e.g., a computational client) may beconfigured to provide access to a virtual compute instance in a mannerthat is transparent to applications implement on the client deviceutilizing computational resources provided by the virtual computeinstance. In at least some embodiments, client devices 180A-180N mayprovision, mount, and configure storage volumes implemented at storageservices for file systems implemented at the client devices.

Client devices 180A-180N may convey network-based service requests toprovider network 100 via external network(s) 190. In variousembodiments, external network(s) 190 may encompass any suitablecombination of networking hardware and protocols necessary to establishnetwork-based communications between client devices 180A-180N andprovider network 100. For example, the network(s) 190 may generallyencompass the various telecommunications networks and service providersthat collectively implement the Internet. The network(s) 190 may alsoinclude private networks such as local area networks (LANs) or wide areanetworks (WANs) as well as public or private wireless networks. Forexample, both a given client device and the provider network 100 may berespectively provisioned within enterprises having their own internalnetworks. In such an embodiment, the network(s) 190 may include thehardware (e.g., modems, routers, switches, load balancers, proxyservers, etc.) and software (e.g., protocol stacks, accounting software,firewall/security software, etc.) necessary to establish a networkinglink between the given client device and the Internet as well as betweenthe Internet and the provider network 100. It is noted that in someembodiments, client devices 180A-180N may communicate with providernetwork 100 using a private network rather than the public Internet.

The provider network 100 may include a plurality of computing devices,any of which may be implemented by the example computing device 3000illustrated in FIG. 18. In various embodiments, portions of thedescribed functionality of the provider network 100 may be provided bythe same computing device or by any suitable number of differentcomputing devices. If any of the components of the provider network 100are implemented using different computing devices, then the componentsand their respective computing devices may be communicatively coupled,e.g., via a network. Each of the illustrated components (such as theelastic graphics service 110 and its constituent functionalities 120 and130) may represent any combination of software and hardware usable toperform their respective functions.

It is contemplated that the provider network 100 may include additionalcomponents not shown, fewer components than shown, or differentcombinations, configurations, or quantities of the components shown. Forexample, although physical compute instances 142A through 142N are shownfor purposes of example and illustration, it is contemplated thatdifferent quantities and configurations of physical compute instancesmay be used. Similarly, although physical GPUs 152A through 152N areshown for purposes of example and illustration, it is contemplated thatdifferent quantities and configurations of physical GPUs may be used.Additionally, although three client devices 180A, 180B, and 180N areshown for purposes of example and illustration, it is contemplated thatdifferent quantities and configurations of client devices may be used.Aspects of the functionality described herein for providing virtualizedgraphics processing may be performed, at least in part, by componentsoutside of the provider network 100.

FIG. 2A illustrates further aspects of the example system environmentfor virtualizing graphics processing in a provider network, includingselection of an instance type and virtual GPU class for a virtualcompute instance with an attached virtual GPU, according to oneembodiment. As discussed above, the provider network 100 may offer tothe client device 180A a plurality of instance types 121 for virtualcompute instances. As shown for purposes of illustration and example,virtual compute instances of type “B” 141B through type “N” 141N may beoffered. However, it is contemplated that any suitable number andconfiguration of virtual compute instance types may be offered toclients by the provider network 100. An instance type may becharacterized by its computational resources (e.g., number, type, andconfiguration of central processing units [CPUs] or CPU cores), memoryresources (e.g., capacity, type, and configuration of local memory),storage resources (e.g., capacity, type, and configuration of locallyaccessible storage), network resources (e.g., characteristics of itsnetwork interface and/or network capabilities), and/or other suitabledescriptive characteristics. Using the instance type selectionfunctionality 120, the client device 180A may provide an indication,specification, or other selection 201 of a particular instance type. Forexample, a client may choose or the instance type “B” from a predefinedset of instance types using input 201. As another example, a client mayspecify the desired resources of an instance type using input 201, andthe instance type selection functionality 120 may select the instancetype “B” based on such a specification. Accordingly, the virtual computeinstance type may be selected by the client or on behalf of the client,e.g., using the instance type selection functionality 120.

As discussed above, the provider network 100 may offer to the clientdevice 180A a plurality of virtual GPU classes 122 for virtual GPUs. Asshown for purposes of illustration and example, virtual GPUs of class“B” 151B through class “N” 151N may be offered. However, it iscontemplated that any suitable number and configuration of virtual GPUclasses may be offered to clients by the provider network 100. A virtualGPU class may be characterized by its computational resources forgraphics processing, memory resources for graphics processing, and/orother suitable descriptive characteristics. In one embodiment, thevirtual GPU classes may represent subdivisions of graphics processingcapabilities of a physical GPU, such as a full GPU, a half GPU, aquarter GPU, and so on. Using the instance type selection functionality120, the client device 180A may provide an indication, specification, orother selection 202 of a particular virtual GPU class. For example, aclient may choose the virtual GPU class “B” from a predefined set ofvirtual GPU classes using input 202. As another example, a client mayspecify the desired resources of a virtual GPU class using input 202,and the instance type selection functionality 120 may select the virtualGPU class “B” based on such a specification. Accordingly, the virtualGPU class may be selected by the client or on behalf of the client,e.g., using the instance type selection functionality 120.

FIG. 2B illustrates further aspects of the example system environmentfor virtualizing graphics processing in a provider network, includingprovisioning of a virtual compute instance with an attached virtual GPU,according to one embodiment. The instance provisioning functionality 130may provision a virtual compute instance 141B with an attached virtualGPU 151B based on the specified instance type “B” and the specifiedvirtual GPU class “B”. The provisioned virtual compute instance 141B maybe implemented by the compute virtualization functionality 140 usingsuitable physical resources such as a physical compute instance 142B,and the provisioned virtual GPU 151B may be implemented by the GPUvirtualization functionality 150 using suitable physical resources suchas a physical GPU 152B. As used herein, provisioning a virtual computeinstance generally includes reserving resources (e.g., computational andmemory resources) of an underlying physical compute instance for theclient (e.g., from a pool of available physical compute instances andother resources), installing or launching required software (e.g., anoperating system), and making the virtual compute instance available tothe client for performing tasks specified by the client. In oneembodiment, a virtual GPU of substantially any virtual GPU class may beattached to a virtual compute instance of substantially any instancetype. To implement the virtual compute instance 141B with the attachedvirtual GPU 151B, a physical compute instance 142B may communicate witha physical GPU 152B, e.g., over a network. The physical GPU 152B may belocated in a different computing device than the physical computeinstance 142B. Even though they may be implemented using separatehardware, the virtual GPU 151B may be said to be attached to the virtualcompute instance 141B, or the virtual compute instance may be said toinclude the virtual GPU. The virtual GPU 151B may be installed on adevice that may reside in various locations relative to the physical GPU152B, e.g., on the same rack, the same switch, the same room, and/orother suitable locations on the same network. A vendor of the physicalGPU 152B may be hidden from the client device 180A.

FIG. 3 illustrates the use of a virtual compute instance with a virtualGPU to generate virtual GPU output for display on a client device,according to one embodiment. After the virtual compute instance 141B isprovisioned with the attached virtual GPU 151B, the client device 180Amay use the provisioned instance and virtual GPU to perform any suitabletasks, e.g., based on input from the client device. The virtual computeinstance 141B may execute a particular application 320. The application320 may be selected or provided by the client. The virtual computeinstance 141B may also be configured with a particular operating system322 that provides support for the application 321. Additionally, thevirtual compute instance 141B may be configured with a particulargraphics driver 321. The graphics driver 321 may interact with thevirtual GPU 151B to provide graphics processing for the application 320,including accelerated two-dimensional graphics processing and/oraccelerated three-dimensional graphics processing. In one embodiment,the graphics driver 321 may implement a graphics application programminginterface (API) such as Direct3D or OpenGL. The graphics driver 321 mayrepresent components running in user mode and/or kernel mode. Additionalcomponents (not shown), such as a graphics runtime, may also be used toprovide accelerated graphics processing on the virtual compute instance141B.

The client device 180A may communicate with the virtual compute instance141B through a proxy 310. Various other communications may be sentthrough the proxy 310, including for example virtual GPU output 302 fromthe virtual GPU 151B to the client device 180A. Use of the proxy 310 mayhide the address of the virtual compute instance and any associatedresources (including a computing device that implements the virtual GPU151B) from the client device 180A. The proxy 310 and virtual computeinstance 141B may communicate using a suitable remoting protocol. Invarious embodiments, the proxy 310 may or may not be part of theprovider network 100. The client device 180A may provide applicationinput 301 to the application 320 running on the virtual compute instance141B. For example, the application input 301 may include data to beoperated upon by the application 320 and/or instructions to control theexecution of the application.

Using the graphics processing provided by the virtual GPU 151B,execution of the application may generate virtual GPU output 302. Thevirtual GPU output 302 may be provided to the client device 180A, e.g.,from the virtual GPU 151B or virtual compute instance 141B. In oneembodiment, the virtual GPU output 302 may be sent from the virtual GPU151B (e.g., from a computing device that includes the virtual GPU) tothe client device 180A while bypassing the rest of the virtual computeinstance 141B (e.g., the underlying physical compute instance 142B). Thevirtual GPU output 302 may also be sent to the client device 180Athrough the proxy 310. The proxy 310 and virtual GPU 151B maycommunicate using a suitable remoting protocol. In one embodiment, thevirtual GPU output 302 may be returned to the virtual compute instance141B, and the virtual compute instance may send the virtual GPU outputto the client device 180A. In one embodiment, the client device 180A mayforward the virtual GPU output 302 to another component.

In one embodiment, a display device 181 associated with the clientdevice 180A may present a display 330 of the virtual GPU output 302. Inone embodiment, the virtual GPU output 302 may include pixel data, imagedata, video data, or other graphical data. In one embodiment, thevirtual GPU output 302 may drive a full-screen display on the displaydevice 181. Portions of the virtual GPU output 302 may be streamed tothe client device 180A over time. In one embodiment, the virtual GPUoutput 302 may be composited with one or more other sources of graphicaldata to produce the display 330. In one embodiment, the virtual GPU 151Bmay be used for general-purpose computing (e.g., GPGPU computing), andthe virtual GPU output 302 may not include pixel data or other graphicaldata. In various embodiments, the client device 180A may process ortransform all or part of the virtual GPU output 302 before displayingthe output. For example, a CPU, GPU, or co-processor on the clientdevice 180A may transform portions of the virtual GPU output 302 anddisplay the results on the display device 181.

In various embodiments, any suitable technique(s) may be used to offloadgraphics processing from a virtual compute instance to a physical GPU.In one embodiment, an API shim may intercept calls to a graphics API andmarshal the calls over a network to an external computing device thatincludes a physical GPU. In one embodiment, a driver shim may surface aproprietary driver to the virtual compute instance, intercept calls, andmarshal the calls over a network to an external computing device thatincludes a physical GPU. In one embodiment, a hardware shim may surfacea hardware interface to the virtual compute instance and marshalattempts by the instance to interact with the physical GPU.

FIG. 4 illustrates an example hardware architecture for implementingvirtualized graphics processing, according to one embodiment. In oneembodiment, the virtual compute instance 141B may be implemented using aphysical compute instance 142B, and the virtual GPU 151B attached tothat instance 141B may be implemented using a separate and distinctcomputing device termed a graphics server 420. The virtual computeinstance 141B may use a virtual interface 400 to interact with aninterface device 410. The virtual interface 400 may enable the virtualcompute instance 141B to send and receive network data. The interfacedevice 410 may include a network interface and a custom hardwareinterface. Via the custom hardware interface, the interface device 410may run program code to emulate a GPU interface and appear to thevirtual compute instance 141B to implement or include the virtual GPU151B. In one embodiment, the interface device 410 may present a graphicsAPI to the virtual compute instance 141B and receive API calls forgraphics processing (e.g., accelerated 3D graphics processing). Via thenetwork interface, the interface device 410 may communicate with thegraphics server 420 (and thus with the physical GPU 152B) over anetwork. The interface device 410 may be implemented in any suitablemanner, e.g., as an expansion card (such as a PCI Express card) orattached peripheral device for the physical compute instance 142B. Theinterface device 410 may use single root I/O virtualization to exposehardware virtual functions to the virtual compute instance 141B. In oneembodiment, the physical compute instance 142B may implement a pluralityof virtual compute instances, each with its own virtual interface, andthe virtual compute instances may use the interface device 410 tointeract with the corresponding virtual GPUs on one or more graphicsservers. The physical compute instance 142B may communicate with theproxy 310 using a suitable remoting protocol, e.g., to send data to andreceive data from the client device 180A.

Graphics offload performed by the interface device 410 (e.g., byexecuting custom program code on the interface device) may translategraphics API commands into network traffic (encapsulating the graphicsAPI commands) that is transmitted to the graphics server 420, and thegraphics server 420 may execute the commands on behalf of the interfacedevice. The graphics server 420 may include a network adapter 440 thatcommunicates with the interface device 410 (e.g., with the networkinterface of the interface device) over a network. In one embodiment,the interface device 410 may receive calls to a graphics API (using thecustom hardware interface) and generate graphics offload traffic to besent to the network adapter 440 (using the network interface). Thegraphics server 410 may implement a graphics virtual machine 430. Anysuitable technologies for virtualization may be used to implement thegraphics virtual machine 430. In one embodiment, the graphics virtualmachine 430 may represent a generic virtual machine that is GPU-capableand is dedicated to providing accelerated graphics processing using oneor more virtual GPUs. The graphics virtual machine 430 may be coupled tothe network adapter 440 using a virtual interface 401. The virtualinterface 401 may enable the graphics virtual machine 430 to send andreceive network data. The graphics virtual machine 430 may implement thevirtual GPU 151B using the graphics processing capabilities of thephysical GPU 152B. In one embodiment, the physical GPU 152B can beaccessed directly by the graphics virtual machine 430, and the physicalGPU 152B can use direct memory access to write to and read from memorymanaged by the graphics virtual machine. In one embodiment, the graphicsserver 420 may implement a plurality of virtual GPUs (such as virtualGPU 151B) using one or more physical GPUs (such as physical GPU 152B),and the virtual GPUs may interact with the corresponding virtual computeinstances on one or more physical compute instances over a network. Thegraphics server 420 may communicate with the proxy 310 using a suitableremoting protocol, e.g., to send data to and receive data from theclient device 180A. For example, the graphics server 420 may generatevirtual GPU output based on the commands sent from the interface device410. The virtual GPU output may be provided to the client device 180Athrough the proxy 310, e.g., from the physical compute instance 142B orgraphics server 420.

FIG. 5 is a flowchart illustrating a method for virtualizing graphicsprocessing in a provider network, according to one embodiment. As shownin 505, a virtual compute instance may be selected. The virtual computeinstance may be selected based (at least in part) on computational andmemory resources provided by the virtual compute instance. For example,the virtual compute instance may be selected based (at least in part) ona selection of an instance type by a user. As shown in 510, a virtualGPU may be selected. The virtual GPU may be selected based (at least inpart) on graphics processing capabilities provided by the virtual GPU.For example, the virtual GPU may be selected based (at least in part) ona selection of a virtual GPU class by a user. The virtual computeinstance and virtual GPU may also be selected based (at least in part)on availability of resources in a resource pool of a provider networkthat manages such resources. In one embodiment, an elastic graphicsservice may receive the specifications for and/or selections of thevirtual compute instance and virtual GPU.

As shown in 515, the selected virtual compute instance may beprovisioned with the selected virtual GPU attached. In one embodiment,the elastic graphics service may interact with one or more otherservices or functionalities of a provider network, such as a computevirtualization functionality and/or GPU virtualization functionality, toprovision the instance with the virtual GPU. The virtual computeinstance may be implemented using central processing unit (CPU)resources and memory resources of a physical compute instance. Thevirtual GPU may be implemented using a physical GPU. The physical GPUmay be attached to a different computing device than the computingdevice that provides the CPU resources for the virtual compute instance.The physical GPU may be accessible to the physical compute instance overa network. The virtual GPU may be said to be attached to the virtualcompute instance, or the virtual compute instance may be said to includethe virtual GPU. In one embodiment, the physical GPU may be sharedbetween the virtual GPU and one or more additional virtual GPUs, and theadditional virtual GPUs may be attached to additional virtual computeinstances. In one embodiment, the virtual GPU may be accessible to thevirtual compute instance via an interface device that includes a networkinterface and a custom hardware interface. Via the custom hardwareinterface, the interface device may emulate a GPU and appear to thevirtual compute instance to include the virtual GPU. Via the networkinterface, the interface device may communicate with the physical GPUover the network.

As shown in 520, an application may be executed on the virtual computeinstance using the virtual GPU. Execution of the application may includeexecution of instructions on the virtual compute instance (e.g., on theunderlying physical compute instance) and/or virtual GPU (e.g., on theunderlying physical GPU). Execution of the application using the virtualGPU may generate virtual GPU output, e.g., output produced by executinginstructions or otherwise performing tasks on the virtual GPU. As shownin 525, the virtual GPU output may be provided to a client device. Thevirtual GPU output may be provided to the client device from the virtualcompute instance or virtual GPU. In one embodiment, the virtual GPUoutput may be displayed on a display device associated with the clientdevice. The virtual GPU output may include pixel information or othergraphical data that is displayed on the display device. Execution of theapplication using the virtual GPU may include graphics processing (e.g.,acceleration of three-dimensional graphics processing) for theapplication using a graphics API.

Application-Specific Virtualized Graphics Processing

In some embodiments, virtualized graphics processing may be provided onan application-specific basis. Using the techniques discussed above forvirtualized graphics processing in a provider network, a virtual computeinstance may be provisioned. The virtual compute instance may beconfigured to execute a particular application. As will be discussed ingreater detail below, a virtual GPU may be attached to the virtualcompute instance specifically for use by the particular application. Theapplication-specific virtual GPU may be dedicated to the particularapplication, and other applications running on the virtual computeinstance may have no access to this particular virtual GPU. In oneembodiment, a plurality of applications on the virtual compute instancemay have their own dedicated virtual GPUs. The capabilities of thevirtual GPUs may vary based on characteristics of the associatedapplications. In one embodiment, one or more other applications on thevirtual compute instance may not have access to any virtual GPUs, e.g.,if the graphics requirements for the other applications are notsufficient to justify the cost of a virtual GPU. As used herein, theterm “application” generally includes a set of program instructions, asoftware package, or a set of interconnected software resources designedto perform a set of coordinated functions when executed on a computeinstance, often on top of an operating system resident on the computeinstance.

FIG. 6A illustrates an example system environment forapplication-specific virtualized graphics processing, includingselection of a virtual GPU based (at least in part) on requirements foran application, according to one embodiment. An application on a virtualcompute instance may be associated with a set of requirements 602. Therequirements 602 may include requirements for graphics processing and/orcomputational requirements and may also be referred to herein asgraphics requirements. For example, the graphics requirements 602 mayspecify a recommended graphics processing unit (GPU) class, arecommended size for video memory, or other GPU features and/orconfigurations that are recommended to run the application. In oneembodiment, the graphics requirements 602 may be determined using anapplication manifest 605 that specifies required or recommendedcharacteristics of a platform (e.g., computational and memoryrequirements) or environment for executing the application, includingcharacteristics of a physical compute instance or virtual computeinstance. The application manifest 605 may be determined and provided bya developer of the corresponding application who seeks a degree ofcontrol over the type of platform or environment on which theapplication is executed. The application may be implemented using anapplication virtualization container, and the manifest may be providedwith the container for the application.

In one embodiment, programmatic analysis 606 of the application maydetermine the graphics requirements 602 for the application. Theapplication analysis 606 may include runtime analysis of a graphicsworkload demanded by the application and/or analysis of an executionhistory (including graphics workload) of the application, e.g., usingsimilar virtual hardware as the current instance. The graphics workloadfor the application, either current or historical, may be based on anysuitable metrics relating to use of a virtual GPU or underlying physicalGPU, such as the number of primitives sent to the GPU, the number ofoperations requested of the GPU, the video memory used by the GPU,and/or the rate of output from the GPU over a period of time.

In one embodiment, the graphics requirements 602 may be provided to theelastic graphics service 110 by a client 180A. In one embodiment, theelastic graphics service 110 may determine the graphics requirements 602directly from the application manifest 605 and/or application analysis606. As shown in FIG. 6A, if the client 180A also seeks to provision avirtual compute instance, the client may provide an indication of therequested instance type 201 for the virtual compute instance along withthe graphics requirements 602 for the application-specific virtual GPU.However, the client may also provide the graphics requirements 602 forthe application-specific virtual GPU for a virtual compute instance thathas already been provisioned and potentially used to execute one or moreapplications.

As discussed above, the elastic graphics service 110 may offer, toclients, selection and provisioning of virtualized compute instanceswith attached virtualized GPUs, including application-specific virtualGPUs. The elastic graphics service 110 may include an instance typeselection functionality 120 and an instance provisioning functionality130. As discussed above, the provider network 100 may offer to theclient device 180A a plurality of instance types 121 for virtual computeinstances. As shown for purposes of illustration and example, virtualcompute instances of type “B” 141B through type “N” 141N may be offered.However, it is contemplated that any suitable number and configurationof virtual compute instance types may be offered to clients by theprovider network 100. An instance type may be characterized by itscomputational resources (e.g., number, type, and configuration ofcentral processing units [CPUs] or CPU cores), memory resources (e.g.,capacity, type, and configuration of local memory), storage resources(e.g., capacity, type, and configuration of locally accessible storage),network resources (e.g., characteristics of its network interface and/ornetwork capabilities), and/or other suitable descriptivecharacteristics. Using the instance type selection functionality 120,the client device 180A may provide an indication, specification, orother selection 201 of a particular instance type. For example, a clientmay choose or the instance type “B” from a predefined set of instancetypes using input 201. As another example, a client may specify thedesired resources of an instance type using input 201, and the instancetype selection functionality 120 may select the instance type “B” basedon such a specification. Accordingly, the virtual compute instance typemay be selected by the client or on behalf of the client, e.g., usingthe instance type selection functionality 120.

As discussed above, the provider network 100 may offer to the clientdevice 180A a plurality of virtual GPU classes 122 for virtual GPUs. Asshown for purposes of illustration and example, virtual GPUs of class“B” 151B through class “N” 151N may be offered. However, it iscontemplated that any suitable number and configuration of virtual GPUclasses may be offered to clients by the provider network 100. A virtualGPU class may be characterized by its computational resources forgraphics processing, memory resources for graphics processing, and/orother suitable descriptive characteristics. In one embodiment, thevirtual GPU classes may represent subdivisions of graphics processingcapabilities of a physical GPU, such as a full GPU, a half GPU, aquarter GPU, and so on. The client device 180A may provideapplication-specific graphics requirements 602 that the instance typeselection functionality 120 may use to select a particular virtual GPUclass. For example, the graphics requirements 602 may specify or mapdirectly to the virtual GPU class “B” from a predefined set of virtualGPU classes. As another example, the graphics requirements 602 mayspecify the desired resources of a virtual GPU class, and the instancetype selection functionality 120 may select the virtual GPU class “B”based on such requirements. If the graphics requirements specify aminimum set of resources for a virtual GPU to be used with anapplication, then a virtual GPU may be selected that meets or exceedsthose minimum set of resources. Accordingly, the virtual GPU class maybe selected by the client or on behalf of the client for use with aparticular application having particular requirements.

In some circumstances, the class of virtual GPU dictated by the graphicsrequirements for the application may not be available. The virtual GPUclass may not be available for technical reasons (e.g., during a busyperiod) or for business reasons (e.g., the selected GPU class is moreexpensive than permitted by an agreement between the user and theprovider network). In such circumstances, the elastic graphics servicemay either return an indication of failure or attempt to reconcile thedifference between the requested virtual GPU class and the availablevirtual GPUs. If a virtual GPU of a lesser class is available, theelastic graphics service may prompt the user for approval. In oneembodiment, the elastic graphics service may seek user approval to waituntil the requested virtual GPU class is available at an acceptablecost.

FIG. 6B illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingprovisioning of a virtual compute instance with an application-specificvirtual GPU attached, according to one embodiment. The instanceprovisioning functionality 130 may provision a virtual compute instance141B with an attached virtual GPU 151B based on the specified instancetype “B” and the virtual GPU class “B” selected based (at least in part)on the application-specific requirements 602. The provisioned virtualcompute instance 141B may be implemented by the compute virtualizationfunctionality 140 using suitable physical resources such as a physicalcompute instance 142B, and the provisioned virtual GPU 151B may beimplemented by the GPU virtualization functionality 150 using suitablephysical resources such as a physical GPU 152B. As used herein,provisioning a virtual compute instance generally includes reservingresources (e.g., computational and memory resources) of an underlyingphysical compute instance for the client (e.g., from a pool of availablephysical compute instances and other resources), installing or launchingrequired software (e.g., an operating system), and making the virtualcompute instance available to the client for performing tasks specifiedby the client. In one embodiment, a virtual GPU of substantially anyvirtual GPU class may be attached to a virtual compute instance ofsubstantially any instance type. To implement the virtual computeinstance 141B with the attached virtual GPU 151B, a physical computeinstance 142B may communicate with a physical GPU 152B, e.g., over anetwork. The physical GPU 152B may be located in a different computingdevice than the physical compute instance 142B. Even though they may beimplemented using separate hardware, the virtual GPU 151B may be said tobe attached to the virtual compute instance 141B, or the virtual computeinstance may be said to include the virtual GPU. The virtual GPU 151Bmay be installed on a device that may reside in various locationsrelative to the physical GPU 152B, e.g., on the same rack, the sameswitch, the same room, and/or other suitable locations on the samenetwork. A vendor of the physical GPU 152B may be hidden from the clientdevice 180A.

The virtual compute instance 141B may be configured to execute anapplication 620. Execution of the application 620 may include using thevirtual GPU 151B to generate output based on data supplied to thevirtual GPU by the application. The virtual GPU 151B may be attached tothe virtual compute instance 141B specifically for use by the particularapplication 620. The application-specific virtual GPU 151B may bededicated to the particular application 620, and other applicationsrunning on the virtual compute instance 141B may have no access to thisparticular virtual GPU 151B.

FIG. 7A illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingselection of a plurality of virtual GPUs based (at least in part) onrequirements for a plurality of applications, according to oneembodiment. In one embodiment, a plurality of applications on thevirtual compute instance may have their own dedicated virtual GPUs. Thecapabilities of the virtual GPUs may vary based on characteristics ofthe associated applications. As shown in the example of FIG. 7A, avirtual compute instance 141C may be provisioned by the computevirtualization facility 140 using resources of a multi-tenant providernetwork 100. In various embodiments, the virtual compute instance 141Cmay be provisioned and used (e.g., to execute one or more applications)before any virtual GPUs are attached or at the same time as the virtualGPUs are attached. The virtual compute instance 141C may be configuredto execute a plurality of applications, such as application 620A throughapplication 620N. The applications 620A-620N may be installed on thevirtual compute instance 141C from any source. The applications620A-620N may vary in their computational requirements and graphicsrequirements. The virtual compute instance 141C may be configured toexecute any two or more of the applications 620A-620N in a substantiallysimultaneous manner, e.g., using multiple processors or processor coresof the underlying physical compute instance and/or software-basedmultitasking techniques.

Each of the applications 620A-620N may be associated with a set ofgraphics requirements. As shown in FIG. 7A, the application 620A may beassociated with requirements 602A, and the application 620N may beassociated with requirements 602N. For example, the graphicsrequirements 602A-602N may specify a recommended graphics processingunit (GPU) class, a recommended size for video memory, or other GPUfeatures and/or configurations that are recommended to run thecorresponding application. In one embodiment, any of the graphicsrequirements 602A-602N may be determined using a correspondingapplication manifest 605A-605N that specifies required or recommendedcharacteristics of a platform or environment for executing thecorresponding application, including characteristics of a physicalcompute instance or virtual compute instance. The application manifest605A-605N may be determined and provided by a developer of thecorresponding application who seeks a degree of control over the type ofplatform or environment on which the application is executed. In oneembodiment, programmatic analysis 606A-606N of the correspondingapplication 620A-620N may determine the graphics requirements 605 forthe application. The application analysis 606A-606N may include runtimeanalysis of a graphics workload demanded by the application and/oranalysis of an execution history (including graphics workload) of theapplication, e.g., using similar virtual hardware as the currentinstance. The graphics workload for the application, either current orhistorical, may be based on any suitable metrics relating to use of avirtual GPU or underlying physical GPU, such as the number of primitivessent to the GPU, the number of operations requested of the GPU, thevideo memory used by the GPU, and/or the rate of output from the GPUover a period of time.

In one embodiment, the graphics requirements 602A-602N may be providedto the elastic graphics service 110 by a client for whom the instance141C was provisioned. In one embodiment, the elastic graphics service110 may determine the graphics requirements 602A-602N directly from theapplication manifest 605A-605N and/or application analysis 606A-606N. Asdiscussed above, the provider network 100 may offer to clients aplurality of virtual GPU classes 122 for virtual GPUs. As shown forpurposes of illustration and example, virtual GPUs of class “B” 151Bthrough class “N” 151N may be offered. However, it is contemplated thatany suitable number and configuration of virtual GPU classes may beoffered to clients by the provider network 100. A virtual GPU class maybe characterized by its computational resources for graphics processing,memory resources for graphics processing, and/or other suitabledescriptive characteristics. In one embodiment, the virtual GPU classesmay represent subdivisions of graphics processing capabilities of aphysical GPU, such as a full GPU, a half GPU, a quarter GPU, and so on.

The application-specific graphics requirements 602A-602N may be used bya virtual GPU selection functionality 720 to select, for any of theapplications 620A-620N, a particular virtual GPU class from among thevirtual GPU classes 122. For example, the graphics requirements 602A mayspecify or map directly to a virtual GPU class “C” from a predefined setof virtual GPU classes 122, and the graphics requirements 602N mayspecify or map directly to a virtual GPU class “N” from the set ofvirtual GPU classes. As another example, the graphics requirements 602Amay specify the desired resources of a virtual GPU class, and thevirtual GPU selection functionality 720 may select the virtual GPU class“C” based on such requirements. Similarly, the graphics requirements602N may specify the desired resources of a virtual GPU class, and thevirtual GPU selection functionality 720 may select the virtual GPU class“N” based on such requirements. If the graphics requirements specify aminimum set of resources for a virtual GPU to be used with anapplication, then a virtual GPU may be selected that meets or exceedsthose minimum set of resources. Accordingly, the virtual GPU classes maybe selected by the client or on behalf of the client for use withparticular applications having particular requirements. In oneembodiment, the elastic graphics service 110 may decline to select andattach a virtual GPU for a particular application based on itsrequirements, e.g., if the requirements are not sufficient to justifythe cost of a virtual GPU and/or the additional latency introduced byGPU virtualization.

FIG. 7B illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingprovisioning of a virtual compute instance with a plurality ofapplication-specific virtual GPUs attached, according to one embodiment.The elastic graphic service 110 may attach application-specific virtualGPUs to the instance 141C in accordance with the virtual GPU classesselected for the corresponding applications 620A-620N. As shown in FIG.7B, a virtual GPU 151C based on the selected virtual GPU class “C” maybe attached to the instance 141C for exclusive use by application 620A.Similarly, a virtual GPU 151N based on the selected virtual GPU class“N” may be attached to the instance 141C for exclusive use byapplication 620N. The provisioned virtual GPUs 151C-151N may beimplemented by the GPU virtualization functionality 150 using suitablephysical resources such as one or more physical GPUs 152A-152N. Toimplement the virtual compute instance 141C with the attached virtualGPUs 151C-151N, a physical compute instance may communicate with one ormore physical GPUs, e.g., over a network. The physical GPUs may belocated in a different computing device than the physical computeinstance. Even though they may be implemented using separate hardware,the virtual GPUs 151C-151N may be said to be attached to the virtualcompute instance 141C, or the virtual compute instance may be said toinclude the virtual GPUs. The virtual GPUs may be installed on one ormore devices that may reside in various locations relative to thephysical GPU, e.g., on the same rack, the same switch, the same room,and/or other suitable locations on the same network. The vendor(s) ofthe physical GPUs may be hidden from the client device that uses thevirtual compute instance 141C.

The virtual compute instance 141C may be configured to execute theapplications 620A-620N. Execution of the application 620A may includeusing the virtual GPU 151C to generate output based on data supplied tothe virtual GPU by the application. The virtual GPU 151C may be attachedto the virtual compute instance 141C specifically for use by theparticular application 620A. The application-specific virtual GPU 151Cmay be dedicated to the particular application 620A, and otherapplications running on the virtual compute instance 141C may have noaccess to this particular virtual GPU 151C. Similarly, execution of theapplication 620N may include using the virtual GPU 151N to generateoutput based on data supplied to the virtual GPU by the application. Thevirtual GPU 151N may be attached to the virtual compute instance 141Cspecifically for use by the particular application 620N. Theapplication-specific virtual GPU 151N may be dedicated to the particularapplication 620N, and other applications running on the virtual computeinstance 141C may have no access to this particular virtual GPU 151N. Inone embodiment, one or more other applications on the virtual computeinstance 141C may not have access to any virtual GPUs, e.g., if thegraphics requirements for the other applications are not sufficient tojustify the cost of a virtual GPU.

In one embodiment, the applications 620A-620N may interact with one ormore graphics drivers 321, as previously discussed with respect to FIG.3. The graphics driver(s) 321 may interact with the virtual GPUs151C-151N to provide graphics processing for the respective applications620A-620N. The graphics processing may include acceleratedtwo-dimensional graphics processing and/or accelerated three-dimensionalgraphics processing. In one embodiment, the graphics driver(s) 321 mayimplement a graphics application programming interface (API) such asDirect3D or OpenGL. The graphics driver(s) 321 may represent componentsrunning in user mode and/or kernel mode. As also as previously discussedwith respect to FIG. 3, a client device may communicate with the virtualcompute instance 141C through a proxy 310. Various other communicationsmay be sent through the proxy 310, including for example virtual GPUoutput from the virtual GPUs 151C-151N to the client device. Use of theproxy 310 may hide the address of the virtual compute instance 141C andany associated resources (including one or more computing devices thatimplement the virtual GPUs 151C-151N) from the client device.

In various embodiments, any suitable technique(s) may be used to offloadgraphics processing from the virtual compute instance 141C to one ormore physical GPUs used to implement the application-specific virtualGPUs 151C-151N. In one embodiment, an API shim may intercept calls to agraphics API and marshal the calls over a network to one or moreexternal computing devices that include physical GPUs. The API shim maybe application-specific, such that an instance of a dynamic link library(DLL) for graphics processing may be opened in the context of theprocess for each application that has a dedicated virtual GPU. The DLLmay connect to a particular one of the virtual GPUs 151C-151N andprovide exclusive access to that virtual GPU on behalf of thecorresponding application. The applications may be implemented usingapplication virtualization containers, and the API shim layer may bebuilt into the container for an application.

As discussed previously with respect to FIG. 4, the virtual computeinstance 141C may be implemented using a physical compute instance, andthe virtual GPUs 151C-151N attached to that instance 141C may beimplemented using one or more graphics servers 420. The virtual computeinstance 141C may use a virtual interface 400 to interact with aninterface device 410. The virtual interface 400 may enable the virtualcompute instance 141C to send and receive network data. The interfacedevice 410 may include a network interface and a custom hardwareinterface. Via the custom hardware interface, the interface device 410may run program code to emulate a GPU interface and appear to thevirtual compute instance 141C to implement or include theapplication-specific virtual GPUs 151C-151N. In one embodiment, theinterface device 410 may present a graphics API to the virtual computeinstance 141C and receive API calls for graphics processing (e.g.,accelerated 3D graphics processing). Via the network interface, theinterface device 410 may communicate with the graphics server 420 (andthus with the physical GPU 152B) over a network. The interface device410 may be implemented in any suitable manner, e.g., as an expansioncard (such as a PCI Express card) or attached peripheral device for thephysical compute instance 142B. The interface device 410 may use singleroot I/O virtualization to expose hardware virtual functions to thevirtual compute instance 141C.

FIG. 7C illustrates further aspects of the example system environmentfor application-specific virtualized graphics processing, includingprovisioning of a virtual compute instance with a plurality ofapplication-specific virtual GPUs dedicated to a single application,according to one embodiment. In one embodiment, the elastic graphicsservice 110 may decline select and attach multiple virtual GPUs for aparticular application based on its requirements. As shown in theexample of FIG. 7C, two or more virtual GPUs 151C-151M may be selectedbased on the requirements 602A for application 620A, and all the virtualGPUs may be attached to the instance 141C for exclusive use by theapplication 620A. The two or more virtual GPUs 151C-151M selected forthe application 620A may collectively meet or exceed the requirements602A. In one embodiment, the two or more virtual GPUs 151C-151M may beof the same class, e.g., class “C,” to facilitate concurrent use by theapplication 620A. Two or more GPUs may be dedicated to a specificapplication for any suitable reason(s). For example, two or more virtualGPUs may be dedicated to a particular application if no single virtualGPU can meet the requirements of the application. As another example,two or more virtual GPUs may be dedicated to a particular application ifno single virtual GPU that meets the requirements of the application iscurrently available in the multi-tenant provider network. As yet anotherexample, two or more virtual GPUs may be dedicated to a particularapplication if no single virtual GPU that meets the requirements of theapplication is currently available within a budget specified by aclient.

Any suitable techniques may be used to permit a single application touse multiple virtual GPUs. In one embodiment, input data from theapplication 620A may be broadcast to all of the application-specificvirtual GPUs 151C-151M, and the virtual GPUs may operate in a concurrentmanner on different portions of the input data. The broadcasting may beperformed using an API shim. The workload may then be divided among thevirtual GPUs 151C-151M, e.g., based on the relative capabilities of thevirtual GPUs. For example, each of the virtual GPUs 151C-151M may bededicated to a particular region of the display, and the output from thevirtual GPUs may be combined to generate each frame. As another example,each of the virtual GPUs 151C-151M may be dedicated to a particularframe in a sequence (e.g., every other frame for two virtual GPUs), andthe output from the virtual GPUs may be combined to generate a sequenceof frames.

In one embodiment, the elastic graphics service 110 may decline toselect and attach a virtual GPU for a particular application. As shownin the example of FIG. 7C, an application-specific virtual GPU may notbe selected or attached for the application 620N based (at least inpart) on the requirements 602N. A virtual GPU may not be dedicated to aspecific application for any suitable reason(s). For example, a virtualGPU may not be dedicated to a particular application if the requirementsfor the application do not justify the cost (to the client) of a virtualGPU and/or the additional network latency introduced by GPUvirtualization. As another example, a virtual GPU may not be dedicatedto a particular application if no virtual GPU that meets therequirements of the application is currently available in themulti-tenant provider network. As yet another example, a virtual GPU maynot be dedicated to a particular application if no virtual GPU iscurrently available within a budget specified by a client. In oneembodiment, the application 620N may still have access to graphicsprocessing provided by a local GPU (as discussed below with respect toFIG. 9A through FIG. 11) and/or a virtual GPU that is attached to theinstance 141C but is not application-specific.

FIG. 8 is a flowchart illustrating a method for providingapplication-specific virtualized graphics processing, according to oneembodiment. As shown in 805, the graphics requirements for anapplication may be determined. A virtual compute instance may beconfigured to execute the application. In one embodiment, an elasticgraphics service may receive the graphics requirements for theapplication, e.g., from a client, or may otherwise determine therequirements without client input. The graphics requirements may specifya recommended graphics processing unit (GPU) class, a recommended sizefor video memory, or other GPU features and/or configurations that arerecommended to run the application. In one embodiment, the graphicsrequirements may be determined using an application manifest thatspecifies required or recommended characteristics of a platform orenvironment for executing the application, including characteristics ofa physical compute instance or virtual compute instance. The applicationmanifest may be determined and provided by a developer of thecorresponding application who seeks a degree of control over the type ofplatform or environment on which the application is executed. In oneembodiment, programmatic analysis of the application may determine thegraphics requirements for the application. The analysis may includeruntime analysis of a graphics workload demanded by the applicationand/or analysis of an execution history (including graphics workload) ofthe application, e.g., using similar virtual hardware as the currentinstance. The graphics workload for the application, either current orhistorical, may be based on any suitable metrics relating to use of avirtual GPU or underlying physical GPU, such as the number of primitivessent to the GPU, the number of operations requested of the GPU, thevideo memory used by the GPU, and/or the rate of output from the GPUover a period of time. The operation shown in 805 may be performedmultiple times for multiple applications, such that the differentgraphics requirements for multiple applications may be determined for aparticular instance.

As shown in 810, a virtual GPU may be selected. The virtual GPU may beselected based (at least in part) on the graphics processingcapabilities it provides and on the graphics requirements for theapplication. For example, if the graphics requirements specify a minimumset of resources for a virtual GPU to be used with an application, thena virtual GPU may be selected that meets or exceeds those minimum set ofresources. The virtual GPU may be selected from a set of virtual GPUclasses characterized by their differing computational resources forgraphics processing, memory resources for graphics processing, and/orother suitable descriptive characteristics. In one embodiment, thevirtual GPU classes may represent subdivisions of graphics processingcapabilities of a physical GPU, such as a full GPU, a half GPU, aquarter GPU, and so on. The application-specific graphics requirementsmay be used to select a particular virtual GPU class. For example, thegraphics requirements may specify or map directly to a particularvirtual GPU class. As another example, the graphics requirements mayspecify the desired resources of a virtual GPU class, and a particularvirtual GPU class may be selected based on such requirements. Thevirtual GPU may also be selected based (at least in part) onavailability of resources in a resource pool of a provider network thatmanages such resources. The operation shown in 810 may be performedmultiple times for multiple applications, such that multipleapplication-specific virtual GPUs may be selected based (at least inpart) on the different graphics requirements for multiple applications.

As shown in 815, the selected virtual GPU may be attached to the virtualcompute instance. In one embodiment, the elastic graphics service mayinteract with one or more other services or functionalities of aprovider network, such as a compute virtualization functionality and/orGPU virtualization functionality, to attach the virtual GPU to theinstance. The virtual compute instance may be implemented using centralprocessing unit (CPU) resources and memory resources of a physicalcompute instance. The virtual GPU may be implemented using a physicalGPU. The physical GPU may be attached to a different computing devicethan the computing device that provides the CPU resources for thevirtual compute instance. The physical GPU may be accessible to thephysical compute instance over a network. The virtual GPU may be said tobe attached to the virtual compute instance, or the virtual computeinstance may be said to include the virtual GPU. In one embodiment, thephysical GPU may be shared between the virtual GPU and one or moreadditional virtual GPUs, and the additional virtual GPUs may be attachedto additional virtual compute instances. In one embodiment, the virtualGPU may be accessible to the virtual compute instance via an interfacedevice that includes a network interface and a custom hardwareinterface. Via the custom hardware interface, the interface device mayemulate a GPU and appear to the virtual compute instance to include thevirtual GPU. Via the network interface, the interface device maycommunicate with the physical GPU over the network. The operation shownin 815 may be performed multiple times for multiple applications, suchthat multiple application-specific virtual GPUs may be attached to thesame instance for multiple applications. The operations shown in 810 and815 may be performed in response to user input or in response to anautomatic determination, e.g., by an elastic graphics service.

As shown in 820, the application may be executed on the virtual computeinstance using the application-specific virtual GPU. Execution of theapplication may include execution of instructions on the virtual computeinstance (e.g., on the underlying physical compute instance) and/orvirtual GPU (e.g., on the underlying physical GPU). Execution of theapplication using the application-specific virtual GPU may generatevirtual GPU output, e.g., output produced by executing instructions orotherwise performing tasks on the virtual GPU. Additional applicationson the virtual compute instance may use different application-specificvirtual GPUs, and the application-specific virtual GPUs may vary ingraphics processing capabilities based on the varying requirements ofthe applications. The operation shown in 820 may be performed multipletimes for multiple applications, such that multiple application-specificvirtual GPUs may be used on the same instance by multiple applications.

As shown in 825, the virtual GPU output may be provided to a clientdevice. The virtual GPU output may be provided to the client device fromthe virtual compute instance or virtual GPU. In one embodiment, thevirtual GPU output may be displayed on a display device associated withthe client device. The virtual GPU output may include pixel informationor other graphical data that is displayed on the display device.Execution of the application using the virtual GPU may include graphicsprocessing (e.g., acceleration of three-dimensional graphics processing)for the application using a graphics API.

Local-to-Remote Migration for Virtualized Graphics Processing

In some embodiments, the graphics processing for one GPU associated witha virtual compute instance maybe migrated to a virtual GPU. In oneembodiment, the graphics processing provided by a local GPU may bemigrated to a virtual GPU. In one embodiment, the graphics processingprovided by a first virtual GPU may be migrated to a second virtual GPU.The local GPU may be implemented using attached hardware (e.g., in aphysical compute instance used to implement the virtual computeinstance) or using emulation. Because the local GPU may provide only alow level of graphics processing capability, a virtual GPU may beattached to the virtual compute instance to provide improved graphicsprocessing relative to the local GPU. In one embodiment, the migrationof graphics processing may be performed based (at least in part) ondetection of an increase in graphics workload. Live migration may beperformed while applications are being executed using the original GPUin a manner that does not require changing or relaunching theapplications. Migration of the virtual compute instance to a differentvirtual compute instance may also be performed, e.g., to reduce networklatency associated with virtualized graphics processing. Graphicsprocessing for a virtual compute instance may also be migrated from onevirtual GPU to another virtual GPU, e.g., from a less capable or smallervirtual GPU class to a more capable or larger virtual GPU class.

FIG. 9A illustrates an example system environment for local-to-remotemigration for virtualized graphics processing, including provisioning ofa virtual compute instance with a local GPU, according to oneembodiment. As discussed above, the elastic graphics service 110 mayoffer, to clients, selection and provisioning of virtualized computeinstances, potentially with attached virtualized GPUs. The elasticgraphics service 110 may include an instance type selectionfunctionality 120 and an instance provisioning functionality 130. Asdiscussed above, the provider network 100 may offer to the client device180A a plurality of instance types for virtual compute instances. Aninstance type may be characterized by its computational resources (e.g.,number, type, and configuration of central processing units [CPUs] orCPU cores), memory resources (e.g., capacity, type, and configuration oflocal memory), storage resources (e.g., capacity, type, andconfiguration of locally accessible storage), network resources (e.g.,characteristics of its network interface and/or network capabilities),and/or other suitable descriptive characteristics. Using the instancetype selection functionality 120, the client device 180A may provide anindication, specification, or other selection 901 of a particularinstance type. For example, a client may choose or the instance type “B”from a predefined set of instance types using input 901. As anotherexample, a client may specify the desired resources of an instance typeusing input 901, and the instance type selection functionality 120 mayselect the instance type “D” based on such a specification. Accordingly,the virtual compute instance type may be selected by the client or onbehalf of the client, e.g., using the instance type selectionfunctionality 120.

The instance provisioning functionality 130 may provision a virtualcompute instance 141D with a local GPU 941 based on the instance type“D.” The provisioned virtual compute instance 141D may be implemented bythe compute virtualization functionality 140 using suitable physicalresources such as a physical compute instance 142C. As used herein,provisioning a virtual compute instance generally includes reservingresources (e.g., computational and memory resources) of an underlyingphysical compute instance for the client (e.g., from a pool of availablephysical compute instances and other resources), installing or launchingrequired software (e.g., an operating system), and making the virtualcompute instance available to the client for performing tasks specifiedby the client.

At the time of its provisioning, the instance 141D may not have anattached virtual GPU. The provisioned instance 141D may be of aninstance type that includes the local GPU 941 in a defaultconfiguration. In one embodiment, the local GPU 941 may be implementedas a hardware component of the physical compute instance 142C used toimplement the virtual compute instance. For example, the local GPU 941may be implemented using the network-capable, customizable interfacedevice 410 shown in FIG. 4. Alternatively, the local GPU 941 may beimplemented using a dedicated physical GPU installed in or attached tothe physical compute instance 142C. In one embodiment, the local GPU 941may be implemented in software using emulation techniques. Typically,the local GPU 941 may provide a low level of graphics processingcapabilities in comparison to the virtual GPUs available through the GPUvirtualization functionality 150 of the provider network 100.

The virtual compute instance 141D may be used to execute one or moreapplications. At least one of the applications may use the local GPU941, e.g., for graphics processing. At some point, a change in graphicsworkload for the local GPU 941 may be detected during the use of thevirtual compute instance 141D. The change in graphics workload may bedetermined based on user input or automatically detected based onprogrammatic monitoring. For example, a user may indicate that thegraphics workload is expected to change for a currently runningapplication or due to an application that will be added to the instance;the user-supplied indication may include a general request for a morecapable virtual GPU or an identification of a specific class of virtualGPU. An automatically detected change in the graphics workload may bebased on any suitable metrics relating to use of a GPU, such as thenumber of primitives sent to the GPU, the number of operations requestedof the GPU, the video memory used by the GPU, and/or the rate of outputfrom the GPU over a period of time. The detected change may typicallyrepresent an increase in graphics workload, e.g., an increase beyond thegraphics capabilities of the local GPU 941. For example, if theapplication is using the local GPU 941 to produce full-screen 2D or 3Dgraphics, the graphics workload may increase such that the frames persecond (fps) decreases below a threshold of acceptable performance. Asanother example, the aggregate graphics workload generated by multipleapplications may push the local GPU 941 beyond a threshold of acceptableperformance as additional applications are executed simultaneously. Anysuitable techniques may be used for monitoring of the graphics workloadand detecting a change therein, and any suitable thresholds may be usedto assess when the graphics workload has increased sufficiently tojustify the attachment of a virtual GPU.

FIG. 9B illustrates further aspects of the example system environmentfor local-to-remote migration for virtualized graphics processing,including the selection and attachment of a virtual GPU to the virtualcompute instance, according to one embodiment. As discussed above, theprovider network 100 may offer a plurality of virtual GPU classes forvirtual GPUs. A virtual GPU class may be characterized by itscomputational resources for graphics processing, memory resources forgraphics processing, and/or other suitable descriptive characteristics.In one embodiment, the virtual GPU classes may represent subdivisions ofgraphics processing capabilities of a physical GPU, such as a full GPU,a half GPU, a quarter GPU, and so on. A particular virtual GPU 151B maybe selected for use with the virtual compute instance 141D, e.g., toreplace or supplement the use of the local GPU 941. The virtual GPU 151Bmay be selected from a set of virtual GPU classes having differentgraphics processing capabilities. The virtual GPU 151B may be selectedto match the current or anticipated graphics workload of the virtualcompute instance. Accordingly, the selected virtual GPU 151B may be of aclass, such as class “B,” that is capable of handling the graphicsworkload with an acceptable level of performance. In one embodiment, theelastic graphics service may store benchmarks or other metrics for eachclass of virtual GPU to indicate the graphics processing capabilitiesrelative to various levels of graphics workload. In one embodiment, thevirtual GPU 151B may be selected not based on a detected change in thegraphics workload but on a configuration change requested by or enabledby a user of the virtual compute instance. For example, if a newapplication is added to the virtual compute instance during its use, anapplication manifest for the new application may require greater GPUperformance than the instance currently provides (e.g., with the localGPU).

The selected virtual GPU 151B may be attached to the virtual computeinstance 141D. In one embodiment, the elastic graphics service 110 mayinteract with one or more other services or functionalities of aprovider network 100, such as a compute virtualization functionality 140and/or GPU virtualization functionality 150, to attach the virtual GPU151B to the instance 141D. The virtual compute instance 141D may beimplemented using central processing unit (CPU) resources and memoryresources of a physical compute instance 142C. The virtual GPU 151B maybe implemented using a physical GPU 152B. The physical GPU 152B may beattached to a different computing device than the computing device 142Cthat provides the CPU resources for the virtual compute instance 141D.The physical GPU 152B may be accessible to the physical compute instance142C over a network. The virtual GPU 151B may be said to be attached tothe virtual compute instance 141D, or the virtual compute instance 141Dmay be said to include the virtual GPU 151B. In one embodiment, thephysical GPU 152B may be shared between the virtual GPU 151B and one ormore additional virtual GPUs, and the additional virtual GPUs may beattached to additional virtual compute instances. In one embodiment, thevirtual GPU 151B may be accessible to the virtual compute instance 141Dvia an interface device that includes a network interface and a customhardware interface. Via the custom hardware interface, the interfacedevice may emulate a GPU and appear to the virtual compute instance 141Dto include the virtual GPU 151B. Via the network interface, theinterface device may communicate with the physical GPU 152B over thenetwork.

Graphics processing for the virtual compute instance 141D may bemigrated from the local GPU 941 to the remotely located virtual GPU151B. Migration of graphics processing may represent replacing thegraphics processing provided by the local GPU 941 with the graphicsprocessing provided by the virtual GPU 151B with respect to one or moreapplications. Graphics processing may include the execution ofinstructions on a GPU, often to produce graphical output based on input.Migration of graphics processing may include discontinuing use of thelocal GPU 941 for graphics processing and initiating use of the virtualGPU 151B for graphics processing with respect to one or moreapplications. In some circumstances, the migration may be performed at atime when no applications are using the local GPU 941. More typically,the migration may be initiated during execution of one or moreapplications and while the application(s) are using the local GPU 941.In one embodiment, the graphics processing may be migrated from thelocal GPU 941 to the virtual GPU 151B based (at least in part) on theincrease in the graphics workload. In one embodiment, thelocal-to-remote migration may be performed based (at least in part) forbusiness reasons, e.g., if a budget for a client is increased such thatthe cost of a virtual GPU can be justified for that client.

When applications are using the local GPU 941 when migration isinitiated, the migration may be referred to as live migration. Toimplement live migration, any currently running applications may bepaused, an interface of the application(s) to the local GPU 941 may bereplaced by an interface to the virtual GPU 151B, any graphicsinstructions and/or data may be transferred to the virtual GPU, and thenthe virtual GPU may be used to resume the graphics processing. In oneembodiment, a shim (such as an API shim) may keep track of graphicsresources (e.g., textures, render targets, and so on) that are used bythe source GPU. To perform the migration, those graphics resources maybe requested, copied via handles, and recreated on the target GPU. Thememory and execution stack may be synchronized between the source GPUand the target GPU; once the target GPU is caught up, the instance maybe paused to perform the migration. In one embodiment, input data may bebroadcast to the local GPU 941 as well as the virtual GPU 151B until thevirtual GPU is ready to take over graphics processing. In oneembodiment, the video memory on the local GPU 941 may be marked ascopy-on-write, the contents of video memory on the local GPU may betransferred to the virtual GPU 151B, and then the “dirty” regions in thememory on the local GPU may be updated on the virtual GPU.

As discussed above with respect to FIG. 3, any suitable technique(s) maybe used to offload graphics processing from a virtual compute instanceto a virtual GPU on a different computing device. In one embodiment, anAPI shim may intercept calls to a graphics API and marshal the calls toan interface device that implements the local GPU. Within the interfacedevice or at the API shim level, an interface to the local GPU 941 maybe replaced by an interface to the virtual GPU 151B such that thegraphics processing is migrated seamlessly and transparently withrespect to the application(s), e.g., without needing to modify orrelaunch the application(s). In one embodiment, a hardware shim maysurface a hardware interface to the virtual compute instance and marshalattempts by the instance to interact with the local GPU.

The physical compute instance 142C and physical GPU 152B may be locatedin the same rack, in different racks in the same data center, indifferent data centers, in different availability zones or regions, orin any other locations relative to one another. In one embodiment,migration of the virtual compute instance to a different virtual computeinstance may also be performed along with local-to-remote migration ofgraphics processing. Migration of the virtual compute instance may beperformed to move to an underlying physical compute instance that iscloser to the selected virtual GPU, e.g., such that the physical computeinstance 142C and physical GPU 152B are in the same rack or otherwise innearby locations in the same data center. Any suitable heuristic(s) maybe used to determine whether to migrate the virtual compute instanceand/or to select the placement of the destination physical computeinstance. For example, the migration of the virtual compute instance maybe performed to reduce network latency associated with virtualizedgraphics processing and/or to reduce usage of a network for virtualizedgraphics processing. Migration of the instance may include livemigration, such that one or more applications executing on the virtualcompute instance may be paused on the source instance and then resumedon the destination instance.

FIG. 10 is a flowchart illustrating a method for local-to-remotemigration of graphics processing from a local GPU to a virtual GPU,according to one embodiment. As shown in 1005, a virtual computeinstance may be provisioned from a multi-tenant provider network. Themulti-tenant provider network may include a plurality of computingdevices configured to implement a plurality of virtual computeinstances. The virtual compute instance may include a local graphicsprocessing unit (GPU). The provisioned instance may be of an instancetype that includes the local GPU in a default configuration. In oneembodiment, the local GPU may be implemented as a hardware component ofthe physical compute instance used to implement the virtual computeinstance. For example, the local GPU may be implemented using thenetwork-capable, customizable interface device 410 shown in FIG. 4.Alternatively, the local GPU may be implemented using a physical GPUinstalled in the physical compute instance. In one embodiment, the localGPU may be implemented in software using emulation techniques.Typically, the local GPU may provide a low level of graphics processingcapabilities in comparison to the virtual GPUs available through anelastic graphics service of the provider network.

Turning back to FIG. 10, the virtual compute instance may be used toexecute one or more applications. At least one of the applications mayuse the local GPU, e.g., for graphics processing. As shown in 1010, achange in graphics workload for the local GPU may be determined duringthe use of the virtual compute instance. The change in graphics workloadmay be determined based on user input or automatically detected based onprogrammatic monitoring. For example, a user may indicate that thegraphics workload is expected to change for a currently runningapplication or due to an application that will be added to the instance;the user-supplied indication may include a general request for a morecapable virtual GPU or an identification of a specific class of virtualGPU. An automatically detected change in the graphics workload may bebased on any suitable metrics relating to use of a GPU, such as thenumber of primitives sent to the GPU, the number of operations requestedof the GPU, the video memory used by the GPU, and/or the rate of outputfrom the GPU over a period of time. The detected change may typicallyrepresent an increase in graphics workload, e.g., an increase beyond thegraphics capabilities of the local GPU. For example, if the applicationis using the local GPU to produce full-screen 2D or 3D graphics, thegraphics workload may increase such that the frames per second (fps)decreases below a threshold of acceptable performance. As anotherexample, the aggregate graphics workload generated by multipleapplications may push the local GPU beyond a threshold of acceptableperformance as additional applications are executed simultaneously. Anysuitable techniques may be used for monitoring of the graphics workloadand detecting a change therein, and any suitable thresholds may be usedto assess when the graphics workload has increased sufficiently tojustify the attachment of a virtual GPU. If a change in the graphicsworkload is determined, then the method may proceed to the operationshown in 1015.

As shown in 1015, a virtual GPU may be selected for use with the virtualcompute instance, e.g., to replace or supplement the use of the localGPU. The virtual GPU may be selected from a set of virtual GPU classeshaving different graphics processing capabilities. The virtual GPU maybe selected to match the current or anticipated graphics workload of thevirtual compute instance. Accordingly, the selected virtual GPU may beof a class that is capable of handling the graphics workload with anacceptable level of performance. In one embodiment, the elastic graphicsservice may store benchmarks or other metrics for each class of virtualGPU to indicate the graphics processing capabilities relative to variouslevels of graphics workload. In one embodiment, the virtual GPU may beselected not based on a detected change in the graphics workload but ona configuration change requested by or enabled by a user of the virtualcompute instance. For example, if a new application is added to thevirtual compute instance during its use, an application manifest for thenew application may require greater GPU performance than the instancecurrently provides (e.g., with the local GPU).

The selected virtual GPU may be attached to the virtual computeinstance. In one embodiment, the elastic graphics service may interactwith one or more other services or functionalities of a providernetwork, such as a compute virtualization functionality and/or GPUvirtualization functionality, to attach the virtual GPU to the instance.The virtual compute instance may be implemented using central processingunit (CPU) resources and memory resources of a physical computeinstance. The virtual GPU may be implemented using a physical GPU. Thephysical GPU may be attached to a different computing device than thecomputing device that provides the CPU resources for the virtual computeinstance. The physical GPU may be accessible to the physical computeinstance over a network. The virtual GPU may be said to be attached tothe virtual compute instance, or the virtual compute instance may besaid to include the virtual GPU. In one embodiment, the physical GPU maybe shared between the virtual GPU and one or more additional virtualGPUs, and the additional virtual GPUs may be attached to additionalvirtual compute instances. In one embodiment, the virtual GPU may beaccessible to the virtual compute instance via an interface device thatincludes a network interface and a custom hardware interface. Via thecustom hardware interface, the interface device may emulate a GPU andappear to the virtual compute instance to include the virtual GPU. Viathe network interface, the interface device may communicate with thephysical GPU over the network.

As shown in 1020, graphics processing for the virtual compute instancemay be migrated from the local GPU to the remote virtual GPU. Migrationof graphics processing may represent replacing the graphics processingprovided by the local GPU with the graphics processing provided by thevirtual GPU with respect to one or more applications. Graphicsprocessing may include the execution of instructions on a GPU, often toproduce graphical output based on input. Migration of graphicsprocessing may include discontinuing use of the local GPU for graphicsprocessing and initiating use of the virtual GPU for graphics processingwith respect to one or more applications. In some circumstances, themigration may be performed at a time when no applications are using thelocal GPU. More typically, the migration may be initiated duringexecution of one or more applications and while the application(s) areusing the local GPU. In one embodiment, the graphics processing may bemigrated from the local GPU to the virtual GPU based (at least in part)on the increase in the graphics workload.

When applications are using the local GPU when migration to the remoteGPU is initiated, the migration may be referred to as live migration. Toimplement live migration, any currently running applications may bepaused, an interface of the application(s) to the local GPU may bereplaced by an interface to the virtual GPU, any graphics instructionsand/or data may be transferred to the virtual GPU, and then the virtualGPU may be used to resume the graphics processing. As discussed abovewith respect to FIG. 3, any suitable technique(s) may be used to offloadgraphics processing from a virtual compute instance to a virtual GPU ona different computing device. For example, an API shim may interceptcalls to a graphics API and marshal the calls to an interface devicethat implements the local GPU. Within the interface device or at the APIshim level, an interface to the local GPU may be replaced by aninterface to the virtual GPU such that the graphics processing ismigrated seamlessly and transparently with respect to theapplication(s), e.g., without needing to modify or relaunch theapplication(s).

Turning back to FIG. 10, as shown in 1025, the application may beexecuted on the virtual compute instance using the virtual GPU.Execution of the application may include execution of instructions onthe virtual compute instance (e.g., on the underlying physical computeinstance) and/or virtual GPU (e.g., on the underlying physical GPU).Execution of the application using the virtual GPU may generate virtualGPU output, e.g., output produced by executing instructions or otherwiseperforming tasks on the virtual GPU. The techniques described herein formigration for virtualized graphics processing may be used with thetechniques described herein for application-specific virtualizedgraphics processing. Accordingly, additional applications on the virtualcompute instance may use different (e.g., application-specific) virtualGPUs and/or the local GPU, and the application-specific virtual GPUsand/or local GPU may vary in graphics processing capabilities based onthe varying requirements of the applications.

As shown in 1030, the virtual GPU output may be provided to a clientdevice. The virtual GPU output may be provided to the client device fromthe virtual compute instance or virtual GPU. In one embodiment, thevirtual GPU output may be displayed on a display device associated withthe client device. The virtual GPU output may include pixel informationor other graphical data that is displayed on the display device.Execution of the application using the virtual GPU may include graphicsprocessing (e.g., acceleration of three-dimensional graphics processing)for the application using a graphics API.

Scaling for Virtualized Graphics Processing

In some embodiments, the graphics processing for a virtual computeinstance maybe migrated from one or more virtual GPUs to another one ormore virtual GPUs. The first set of one or more virtual GPUs may providea particular level of graphics processing. After a change in GPUrequirements for the instance is determined, a second set of one or morevirtual GPU(s) may be selected and attached to the virtual computeinstance to replace the graphics processing of the first virtual GPU(s)with a different level of graphics processing. The second virtual GPU(s)may be selected based on the change in GPU requirements. Depending uponthe change in GPU requirements, such a scaling operation may migrategraphics processing for a virtual compute instance from a less capableor smaller virtual GPU class to a more capable or larger virtual GPUclass or from a more capable or larger virtual GPU class to a lesscapable or smaller virtual GPU class. In one embodiment, the migrationof graphics processing may be performed based (at least in part) on userinput representing a change in GPU requirements. In one embodiment, themigration of graphics processing may be performed based (at least inpart) on detection of an increase in graphics workload. Live migrationmay be performed while applications are being executed using the firstvirtual GPU(s) in a manner that does not require changing or relaunchingthe applications. Migration of the virtual compute instance to adifferent virtual compute instance may also be performed, e.g., toreduce network latency associated with virtualized graphics processing.

FIG. 11A illustrates an example system environment for scaling forvirtualized graphics processing, including a virtual compute instancewith a first virtual GPU attached, according to one embodiment. Asdiscussed above, the elastic graphics service 110 may offer, to clients,selection and provisioning of virtualized compute instances, potentiallywith attached virtualized GPUs. As shown in the example of FIG. 11A, avirtual compute instance 141E may be provisioned in the provider network100. The provisioned virtual compute instance 141E may be implemented bythe compute virtualization functionality 140 using suitable physicalresources such as a physical compute instance 142E. As used herein,provisioning a virtual compute instance generally includes reservingresources (e.g., computational and memory resources) of an underlyingphysical compute instance for the client (e.g., from a pool of availablephysical compute instances and other resources), installing or launchingrequired software (e.g., an operating system), and making the virtualcompute instance available to the client for performing tasks specifiedby the client. Before or after the time of its provisioning, theinstance 141E may have an attached virtual GPU 151B of a particularclass, such as class “B.” The virtual compute instance 141E may be usedto execute one or more applications. At least one of the applicationsmay use the virtual GPU 151B, e.g., for graphics processing. The virtualGPU 151B may be implemented using physical GPU resources 152 of theprovider network, potentially including physical GPUs 152A-152N. Thephysical GPU resources 152 may be accessible to the physical computeinstance 142E over a network.

At some point, a change in GPU requirements or other requirements may bedetermined for the virtual compute instance 141E, e.g., during the useof the virtual compute instance. The change in requirements may indicatea need for more graphics processing capability or less graphicsprocessing capability for the instance. In one embodiment, the change inrequirements may be determined based (at least in part) on user inputfor requirements 1101, e.g., by a client 180A of the instance. Forexample, a user may supply requirements 1101 indicating that thegraphics workload is expected to change for a currently runningapplication or due to an application that will be added to the instance.In one embodiment, the user-supplied requirements 1101 may include ageneral request for a more or less capable virtual GPU or anidentification of a specific class of virtual GPU. The user inputassociated with the requirements 1101 may directly specify a desiredclass of a virtual GPU or other features of a virtual GPU, or the userinput may be transformed and mapped to a desired class of a virtual GPUor other features of a virtual GPU by the elastic graphics service 110.The requirements 1101 specified by the user may include GPU requirementsfor graphics processing as well as computational requirements. The GPUrequirements may specify a recommended graphics processing unit (GPU)class, a recommended size for video memory, or other GPU features and/orconfigurations that are recommended to run the application. In oneembodiment, the GPU requirements may be determined using an applicationmanifest that specifies required or recommended characteristics of aplatform (e.g., computational and memory requirements) or environmentfor executing the application, including characteristics of a physicalcompute instance or virtual compute instance. For example, if a newapplication is added to the virtual compute instance during its use, anapplication manifest for the new application may require greater GPUperformance than the instance currently provides (e.g., with the virtualGPU 141E). As another example, the requirements 1101 may represent achange in cost requirements or budgetary requirements for the user, suchthat scaling of virtualized graphics processing may be performed based(at least in part) on the relative costs of different classes of virtualGPUs.

In one embodiment, the change in requirements may be determined based(at least in part) on performance monitoring 1110. Any suitabletechniques may be used to perform performance monitoring 1110 of thevirtual compute instance 141E and/or virtual GPU 151B. The performancemonitoring 1110 may determine any suitable set of performance metrics,e.g., metrics related to the use of the virtual GPU 151B by the instance141E. For example, a graphics workload for the virtual GPU 151B may bedetected during the use of the virtual compute instance. The graphicsworkload may be based on any suitable metrics relating to use of a GPU,such as the number of primitives sent to the GPU, the number ofoperations requested of the GPU, the video memory used by the GPU,and/or the rate of output from the GPU over a period of time. Thedetected change may represent an increase or decrease in graphicsworkload, e.g., an increase beyond the graphics capabilities of thevirtual GPU 151B or a decrease well below its full graphicscapabilities. For example, if the application is using the virtual GPU151B to produce full-screen 2D or 3D graphics, the graphics workload mayincrease such that the frames per second (fps) decreases below athreshold of acceptable performance. As another example, the aggregategraphics workload generated by multiple applications may push thevirtual GPU 151B beyond a threshold of acceptable performance asadditional applications are executed simultaneously. Any suitabletechniques may be used for monitoring 1110 of the graphics workload anddetecting a change therein, and any suitable thresholds may be used toassess when the graphics workload has changed sufficiently to justifythe attachment of a different set of one or more virtual GPUs.

The elastic graphics service 110 may include a functionality for virtualGPU scaling 1120. Using the scaling functionality 1120, the elasticgraphics service may determine that the requirements for the instance141E have changed sufficiently to justify the attachment of a differentset of one or more virtual GPUs to replace the virtual GPU 151B. Achange in requirements may be insufficient to cause scaling, and so thescaling functionality 1120 may use any suitable heuristics and/orthresholds to determine when to replace the virtual GPU 151B. Thescaling functionality 1120 may determine a change in requirements based(at least in part) on the user-specified requirements 1101 and/or onperformance monitoring 1110. The scaling functionality 1120 may use thevirtual GPU selection functionality 720 to select a new set of one ormore virtual GPUs, e.g., based on the change in GPU requirements.

FIG. 11B illustrates further aspects of the example system environmentfor scaling for virtualized graphics processing, including thereplacement of the first virtual GPU with a second virtual GPU for thevirtual compute instance, according to one embodiment. Using the virtualGPU scaling functionality 1120, the elastic graphics service 110 mayremove the virtual GPU 151B from the virtual compute instance 141E andreplace it with another virtual GPU 151A attached to the virtual computeinstance. The virtual GPU 151A may be selected based (at least in part)on the change in requirements. The virtual GPU 151A may provide adifferent level of graphics processing relative to the virtual GPU 151B,such as a lesser level or a greater level. The level of graphicsprocessing may refer to the graphics processing power or ability of avirtual GPU as measured by any suitable metric(s), such as the number ofprimitives sent to the GPU(s), the number of operations requested of theGPU(s), the video memory used by the GPU(s), and/or the rate of outputfrom the GPU(s) over a period of time.

As discussed above, the provider network 100 may offer a plurality ofvirtual GPU classes for virtual GPUs. A virtual GPU class may becharacterized by its computational resources for graphics processing,memory resources for graphics processing, and/or other suitabledescriptive characteristics. In one embodiment, the virtual GPU classesmay represent subdivisions of graphics processing capabilities of aphysical GPU, such as a full GPU, a half GPU, a quarter GPU, and so on.The particular virtual GPU 151A may be selected for use with the virtualcompute instance 141E, e.g., to replace the use of the virtual GPU 151B.The virtual GPU 151A may be selected from a set of virtual GPU classeshaving different graphics processing capabilities. The virtual GPU 151Amay be selected to meet or exceed the current or anticipated GPUrequirements of the virtual compute instance. Accordingly, the selectedvirtual GPU 151A may be of a class, such as class “A,” that is capableof handling a particular graphics workload or other GPU requirementswith an acceptable level of performance. In one embodiment, the elasticgraphics service may store benchmarks or other metrics for each class ofvirtual GPU to indicate the graphics processing capabilities relative tovarious levels of graphics workload.

The virtual GPU 151B may be removed from the virtual compute instance141E, and the selected virtual GPU 151A may be attached to the virtualcompute instance. In one embodiment, the elastic graphics service 110may interact with one or more other services or functionalities of aprovider network 100, such as a compute virtualization functionality 140and/or GPU virtualization functionality 150, to remove the virtual GPU151B from the instance 141E and return the virtual GPU (and/or thephysical GPU resources used to implement it) to a pool of availableresources in the provider network. In one embodiment, the elasticgraphics service 110 may interact with one or more other services orfunctionalities of a provider network 100, such as a computevirtualization functionality 140 and/or GPU virtualization functionality150, to attach the virtual GPU 151A to the instance 141E. The virtualcompute instance 141E may be implemented using central processing unit(CPU) resources and memory resources of a physical compute instance142E. The virtual GPU 151A may be implemented using the physical GPUresources 152 of the provider network. The physical GPU(s) 152 may beattached to a different computing device than the computing device 142Ethat provides the CPU resources for the virtual compute instance 141E.The physical GPU(s) 152 may be accessible to the physical computeinstance 142E over a network. The virtual GPU 151A may be said to beattached to the virtual compute instance 141E, or the virtual computeinstance 141E may be said to include the virtual GPU 151A. In oneembodiment, the physical GPU(s) 152 may be shared between the virtualGPU 151A and one or more additional virtual GPUs, and the additionalvirtual GPUs may be attached to additional virtual compute instances. Inone embodiment, the virtual GPU 151A may be accessible to the virtualcompute instance 141E via an interface device that includes a networkinterface and a custom hardware interface. Via the custom hardwareinterface, the interface device may emulate a GPU and appear to thevirtual compute instance 141E to include the virtual GPU 151A. Via thenetwork interface, the interface device may communicate with thephysical GPU(s) 152 over the network.

Graphics processing for the virtual compute instance 141E may bemigrated from the virtual GPU 151B to the newly attached virtual GPU151A. Migration of graphics processing may represent replacing thegraphics processing provided by the virtual GPU 151B with the graphicsprocessing provided by the virtual GPU 151A with respect to one or moreapplications. Graphics processing may include the execution ofinstructions on a GPU, often to produce graphical output based on input.Migration of graphics processing may include discontinuing use of thevirtual GPU 151B for graphics processing and initiating use of thevirtual GPU 151A for graphics processing with respect to one or moreapplications. In some circumstances, the migration may be performed at atime when no applications are using the virtual GPU 151B. Moretypically, the migration may be initiated during execution of one ormore applications and while the application(s) are using the virtual GPU151B. In one embodiment, the graphics processing may be migrated fromthe virtual GPU 151B to the virtual GPU 151A based (at least in part) onthe change in GPU requirements. In one embodiment, the scaling may beperformed based (at least in part) for business reasons, e.g., if abudget for a client is increased such that the cost of the virtual GPU141A can be justified for that client, or if the budget for the clientis decreased such that the cost of the virtual GPU 151B can no longer bejustified for that client.

When applications are using the virtual GPU 151B when migration isinitiated, the migration may be referred to as live migration. Toimplement live migration, any currently running applications may bepaused, an interface of the application(s) to the virtual GPU 151B maybe replaced by an interface to the virtual GPU 151A, any graphicsinstructions and/or data may be transferred to the virtual GPU 151A, andthen the virtual GPU 151A may be used to resume the graphics processing.In one embodiment, a shim (such as an API shim) may keep track ofgraphics resources (e.g., textures, render targets, and so on) that areused by the source GPU. To perform the migration, those graphicsresources may be requested, copied via handles, and recreated on thetarget GPU. The memory and execution stack may be synchronized betweenthe source GPU and the target GPU; once the target GPU is caught up, theinstance may be paused to perform the migration. In one embodiment,input data may be broadcast to the virtual GPU 151B as well as thevirtual GPU 151A until the virtual GPU 151A is ready to take overgraphics processing. In one embodiment, the video memory on the virtualGPU 151B may be marked as copy-on-write, the contents of video memory onthe virtual GPU 151B may be transferred to the virtual GPU 151A, andthen the “dirty” regions in the memory on the virtual GPU 151B may beupdated on the virtual GPU 151A.

As discussed above with respect to FIG. 3, any suitable technique(s) maybe used to offload graphics processing from a virtual compute instanceto a virtual GPU on a different computing device. In one embodiment, anAPI shim may intercept calls to a graphics API and marshal the calls toan interface device. Within the interface device or at the API shimlevel, an interface to the virtual GPU 151B may be replaced by aninterface to the virtual GPU 151A such that the graphics processing ismigrated seamlessly and transparently with respect to theapplication(s), e.g., without needing to modify or relaunch theapplication(s). In one embodiment, a hardware shim may surface ahardware interface to the virtual compute instance and marshal attemptsby the instance to interact with the virtual GPU 151B.

The physical compute instance 142E and physical GPU(s) 152 may belocated in the same rack, in different racks in the same data center, indifferent data centers, in different availability zones or regions, orin any other locations relative to one another. Migration of the virtualcompute instance may be performed to move to an underlying physicalcompute instance that is closer to the selected virtual GPU, e.g., suchthat the physical compute instance 142E and physical GPU(s) 152 are inthe same rack or otherwise in nearby locations in the same data center.Any suitable heuristic(s) may be used to determine whether to migratethe virtual compute instance and/or to select the placement of thedestination physical compute instance. For example, the migration of thevirtual compute instance may be performed to reduce network latencyassociated with virtualized graphics processing and/or to reduce usageof a network for virtualized graphics processing. Migration of theinstance may include live migration, such that one or more applicationsexecuting on the virtual compute instance may be paused on the sourceinstance and then resumed on the destination instance.

FIG. 11C illustrates further aspects of the example system environmentfor scaling for virtualized graphics processing, including the additionof a second virtual GPU to the first virtual GPU for the virtual computeinstance, according to one embodiment. As discussed above, the virtualcompute instance 141E may have an attached virtual GPU 151B. In oneembodiment, the scaling functionality 1120 may determine that thevirtual GPU 151B should be replaced by a set of multiple virtual GPUs.In one embodiment, set of multiple virtual GPUs may also include theoriginal virtual GPU 151B, such that the virtual GPU 151B may besupplemented by one or more additional virtual GPUs. As shown in theexample of FIG. 11C, the virtual GPU scaling functionality 1120 mayscale up the level of graphics processing for the instance 141 such thata set of virtual GPUs 151B through 151D are attached to the instance toprovide graphics processing. The set of virtual GPUs 151B-151D may beimplemented by the physical GPU resources 152 as discussed above. Theset of virtual GPUs 151B-151D may typically (but not necessarily) be ofthe same class, such as class “B.” It is also contemplated that thevirtual GPU 151B may be replaced entirely by a set of multiple virtualGPUs of the same class or of a different class. The multiple virtualGPUs 151B-151D may collectively provide a greater level of graphicsprocessing than the single virtual GPU 151B. Any suitable techniques maybe used to distribute a workload among the multiple virtual GPUs151B-151D, such as broadcasting input data to all of the virtual GPUsand using the virtual GPUs to operate in a concurrent manner ondifferent portions of the input data.

FIG. 12A illustrates an example system environment for scaling forvirtualized graphics processing, including a virtual compute instancewith two virtual GPUs attached, according to one embodiment. A virtualcompute instance 141F may be provisioned in the provider network 100.The provisioned virtual compute instance 141F may be implemented by thecompute virtualization functionality 140 using suitable physicalresources such as a physical compute instance 142F. At the time of itsprovisioning or after its provisioning, the virtual compute instance141F may have a set of attached virtual GPUs 151B through 151D. The setof virtual GPUs 151B-151D may be implemented by the physical GPUresources 152 as discussed above. The set of virtual GPUs 151B-151D maytypically (but not necessarily) be of the same class, such as class “B.”Any suitable techniques may be used to distribute a workload among themultiple virtual GPUs 151B-151D, such as broadcasting input data to allof the virtual GPUs and using the virtual GPUs to operate in aconcurrent manner on different portions of the input data.

In one embodiment, the scaling functionality 1120 may determine that thevirtual GPUs 151B-151D should be replaced a different set of one or morevirtual GPUs to provide a different level of graphics processing for theinstance 141F, e.g., based on a change in GPU requirements determinedbased on user input 1101 and/or on performance monitoring 1110. In oneembodiment, additional virtual GPUs, typically of the same class, may beadded to the virtual GPUs 151B-151D. In one embodiment, one or more ofthe virtual GPUs 151B-151D may be removed from the attached set ofvirtual GPUs. In one embodiment, the virtual GPUs 151B-151D may bereplaced by multiple virtual GPUs of a different class. As will bediscussed below, the virtual GPUs 151B-151D may be replaced by a singlevirtual GPU.

FIG. 12B illustrates further aspects of the example system environmentfor scaling for virtualized graphics processing, including thereplacement of the virtual GPUs with a single virtual GPU for thevirtual compute instance, according to one embodiment. Using the virtualGPU scaling functionality 1120, the elastic graphics service 110 mayremove the virtual GPUs 151B-151D from the virtual compute instance 141Fand replace them with another virtual GPU 151A attached to the virtualcompute instance. The virtual GPU 151A may be selected based (at leastin part) on the change in GPU requirements. The virtual GPU 151A mayprovide a different level of graphics processing relative to the virtualGPUs 151B-151D. The level of graphics processing may refer to thecollective graphics processing power or ability of one or more virtualGPUs as measured by any suitable metric(s), such as the number ofprimitives sent to the GPU(s), the number of operations requested of theGPU(s), the video memory used by the GPU(s), and/or the rate of outputfrom the GPU(s) over a period of time. In one embodiment, the singlevirtual GPU 151A may be of a more capable class and may provide agreater level of graphics processing than the multiple virtual GPUs151B-151D. In one embodiment, the single virtual GPU 151A may provide alesser level of graphics processing than the multiple virtual GPUs151B-151D.

As discussed above, the provider network 100 may offer a plurality ofvirtual GPU classes for virtual GPUs. A virtual GPU class may becharacterized by its computational resources for graphics processing,memory resources for graphics processing, and/or other suitabledescriptive characteristics. In one embodiment, the virtual GPU classesmay represent subdivisions of graphics processing capabilities of aphysical GPU, such as a full GPU, a half GPU, a quarter GPU, and so on.The particular virtual GPU 151A may be selected for use with the virtualcompute instance 141F, e.g., to replace the use of the virtual GPUs151B-151D. The virtual GPU 151A may be selected from a set of virtualGPU classes having different graphics processing capabilities. Thevirtual GPU 151A may be selected to meet or exceed the current oranticipated GPU requirements of the virtual compute instance.Accordingly, the selected virtual GPU 151A may be of a class, such asclass “A,” that is capable of handling a particular graphics workload orother GPU requirements with an acceptable level of performance. In oneembodiment, the elastic graphics service may store benchmarks or othermetrics for each class of virtual GPU to indicate the graphicsprocessing capabilities relative to various levels of graphics workload.

The virtual GPUs 151B-151D may be removed from the virtual computeinstance 141F, and the selected virtual GPU 151A may be attached to thevirtual compute instance. In one embodiment, the elastic graphicsservice 110 may interact with one or more other services orfunctionalities of a provider network 100, such as a computevirtualization functionality 140 and/or GPU virtualization functionality150, to remove the virtual GPUs 151B-151D from the instance 141F andreturn the virtual GPUs (and/or the physical GPU resources used toimplement them) to a pool of available resources in the providernetwork. In one embodiment, the elastic graphics service 110 mayinteract with one or more other services or functionalities of aprovider network 100, such as a compute virtualization functionality 140and/or GPU virtualization functionality 150, to attach the virtual GPU151A to the instance 141F. The virtual compute instance 141F may beimplemented using central processing unit (CPU) resources and memoryresources of a physical compute instance 142F. The virtual GPU 151A maybe implemented using the physical GPU resources 152 of the providernetwork. The physical GPU(s) 152 may be attached to a differentcomputing device than the computing device 142F that provides the CPUresources for the virtual compute instance 141F. The physical GPU(s) 152may be accessible to the physical compute instance 142F over a network.The virtual GPU 151A may be said to be attached to the virtual computeinstance 141F, or the virtual compute instance 141F may be said toinclude the virtual GPU 151A. In one embodiment, the physical GPU(s) 152may be shared between the virtual GPU 151A and one or more additionalvirtual GPUs, and the additional virtual GPUs may be attached toadditional virtual compute instances. In one embodiment, the virtual GPU151A may be accessible to the virtual compute instance 141F via aninterface device that includes a network interface and a custom hardwareinterface. Via the custom hardware interface, the interface device mayemulate a GPU and appear to the virtual compute instance 141F to includethe virtual GPU 151A. Via the network interface, the interface devicemay communicate with the physical GPU(s) 152 over the network.

Graphics processing for the virtual compute instance 141F may bemigrated from the virtual GPUs 151B-151D to the newly attached virtualGPU 151A. Migration of graphics processing may represent replacing thegraphics processing provided by the virtual GPUs 151B-151D with thegraphics processing provided by the virtual GPU 151A with respect to oneor more applications. Graphics processing may include the execution ofinstructions on a GPU, often to produce graphical output based on input.Migration of graphics processing may include discontinuing use of thevirtual GPUs 151B-151D for graphics processing and initiating use of thevirtual GPU 151A for graphics processing with respect to one or moreapplications. In some circumstances, the migration may be performed at atime when no applications are using the virtual GPUs 151B-151D. Moretypically, the migration may be initiated during execution of one ormore applications and while the application(s) are using the virtualGPUs 151B-151D. In one embodiment, the graphics processing may bemigrated from the virtual GPUs 151B-151D to the virtual GPU 151A based(at least in part) on the change in GPU requirements. In one embodiment,the scaling may be performed based (at least in part) for businessreasons, e.g., if a budget for a client is increased such that theincreased cost of the virtual GPU 151A can be justified for that client,or if the budget for the client is decreased such that the cost of thevirtual GPUs 151B-151D can no longer be justified for that client.

When applications are using the virtual GPUs 151B-151D when migration isinitiated, the migration may be referred to as live migration. Toimplement live migration, any currently running applications may bepaused, an interface of the application(s) to the virtual GPUs 151B-151Dmay be replaced by an interface to the virtual GPU 151A, any graphicsinstructions and/or data may be transferred to the virtual GPU 151A, andthen the virtual GPU 151A may be used to resume the graphics processing.In one embodiment, a shim (such as an API shim) may keep track ofgraphics resources (e.g., textures, render targets, and so on) that areused by the source GPU. To perform the migration, those graphicsresources may be requested, copied via handles, and recreated on thetarget GPU. The memory and execution stack may be synchronized betweenthe source GPU and the target GPU; once the target GPU is caught up, theinstance may be paused to perform the migration. In one embodiment,input data may be broadcast to the virtual GPUs 151B-151D as well as thevirtual GPU 151A until the virtual GPU 151A is ready to take overgraphics processing. In one embodiment, the video memory on the virtualGPUs 151B-151D may be marked as copy-on-write, the contents of videomemory on the virtual GPUs 151B-151D may be transferred to the virtualGPU 151A, and then the “dirty” regions in the memory on the virtual GPUs151B-151D may be updated on the virtual GPU 151A.

As discussed above with respect to FIG. 3, any suitable technique(s) maybe used to offload graphics processing from a virtual compute instanceto a virtual GPU on a different computing device. In one embodiment, anAPI shim may intercept calls to a graphics API and marshal the calls toan interface device. Within the interface device or at the API shimlevel, an interface to the virtual GPUs 151B-151D may be replaced by aninterface to the virtual GPU 151A such that the graphics processing ismigrated seamlessly and transparently with respect to theapplication(s), e.g., without needing to modify or relaunch theapplication(s). In one embodiment, a hardware shim may surface ahardware interface to the virtual compute instance and marshal attemptsby the instance to interact with the virtual GPUs 151B-151D.

The physical compute instance 142F and physical GPU(s) 152 may belocated in the same rack, in different racks in the same data center, indifferent data centers, in different availability zones or regions, orin any other locations relative to one another. Migration of the virtualcompute instance may be performed to move to an underlying physicalcompute instance that is closer to the selected virtual GPU, e.g., suchthat the physical compute instance 142F and physical GPU(s) 152 are inthe same rack or otherwise in nearby locations in the same data center.Any suitable heuristic(s) may be used to determine whether to migratethe virtual compute instance and/or to select the placement of thedestination physical compute instance. For example, the migration of thevirtual compute instance may be performed to reduce network latencyassociated with virtualized graphics processing and/or to reduce usageof a network for virtualized graphics processing. Migration of theinstance may include live migration, such that one or more applicationsexecuting on the virtual compute instance may be paused on the sourceinstance and then resumed on the destination instance.

FIG. 13 is a flowchart illustrating a method for scaling for virtualizedgraphics processing, according to one embodiment. A virtual computeinstance may be provisioned from a multi-tenant provider network. Themulti-tenant provider network may include a plurality of computingdevices configured to implement a plurality of virtual computeinstances. As shown in 1305, one or more virtual GPUs (referred toherein as the first set of one or more virtual GPUs) may be attached tothe virtual compute instance either at the time of provisioning orafterwards. The virtual compute instance may be implemented usingcentral processing unit (CPU) resources and memory resources of aphysical compute instance. The first virtual GPU(s) may be implementedusing physical GPU resources (e.g., one or more physical GPU(s) of theprovider network. The physical GPU(s) may be attached to a differentcomputing device than the computing device that provides the CPUresources for the virtual compute instance. The physical GPU(s) may beaccessible to the physical compute instance over a network.

The first virtual GPU(s) may provide a particular level of graphicsprocessing capabilities, e.g., as associated with one or more virtualGPU classes to which the set belongs. If the first set includes morethan one virtual GPU, then the multiple virtual GPUs may typically (butnot necessarily) be of the same class. The virtual compute instance maybe used to execute one or more applications. At least one of theapplications may use the first virtual GPU, e.g., for graphicsprocessing. If the first set includes more than one virtual GPU, thenany suitable techniques may be used to distribute a workload among themultiple virtual GPUs, such as broadcasting input data to all of thevirtual GPUs and using the virtual GPUs to operate in a concurrentmanner on different portions of the input data.

As shown in 1310, a change in requirements for the instance may bedetermined. The change in requirements may indicate a need for moregraphics processing capability or less graphics processing capabilityfor the instance. In one embodiment, the change in requirements may bedetermined based (at least in part) on user input, e.g., by a user ofthe instance. The user input associated with the requirements maydirectly specify a desired class of a virtual GPU or other features of avirtual GPU, or the user input may be transformed and mapped to adesired class of a virtual GPU or other features of a virtual GPU by theelastic graphics service. The requirements specified by the user mayinclude GPU requirements for graphics processing as well ascomputational requirements. The GPU requirements may specify arecommended graphics processing unit (GPU) class, a recommended size forvideo memory, or other GPU features and/or configurations that arerecommended to run the application. In one embodiment, the requirementsmay be determined using an application manifest that specifies requiredor recommended characteristics of a platform (e.g., computational andmemory requirements) or environment for executing the application,including characteristics of a physical compute instance or virtualcompute instance. For example, if a new application is added to thevirtual compute instance during its use, an application manifest for thenew application may require greater GPU performance than the instancecurrently provides (e.g., with the first virtual GPU(s)).

In one embodiment, the change in requirements may be determined based(at least in part) on performance monitoring. Any suitable techniquesmay be used to perform performance monitoring of the virtual computeinstance and/or first virtual GPU(s). The performance monitoring maydetermine any suitable set of performance metrics, e.g., metrics relatedto the use of the first virtual GPU(s) by the instance. For example, agraphics workload for the first virtual GPU(s) may be detected duringthe use of the virtual compute instance. The graphics workload may bebased on any suitable metrics relating to use of a GPU, such as thenumber of primitives sent to the GPU, the number of operations requestedof the GPU, the video memory used by the GPU, and/or the rate of outputfrom the GPU over a period of time. The detected change may represent anincrease or decrease in graphics workload, e.g., an increase beyond thegraphics capabilities of the first virtual GPU(s) or a decrease wellbelow its full graphics capabilities. For example, if the application isusing the first virtual GPU(s) to produce full-screen 2D or 3D graphics,the graphics workload may increase such that the frames per second (fps)decreases below a threshold of acceptable performance. As anotherexample, the aggregate graphics workload generated by multipleapplications may push the first virtual GPU(s) beyond a threshold ofacceptable performance as additional applications are executedsimultaneously. Any suitable techniques may be used for monitoring ofthe graphics workload and detecting a change therein, and any suitablethresholds may be used to assess when the graphics workload has changedsufficiently to justify the attachment of a different set of one or morevirtual GPUs.

As shown in 1315, a second set of one or more virtual GPUs may beselected for use with the virtual compute instance and attached to theinstance to replace the use of the first virtual GPU(s). The secondvirtual GPU(s) may be selected based (at least in part) on the change inrequirements. The second set of virtual GPU(s) may provide a differentlevel of graphics processing relative to the first virtual GPU(s), suchas a lesser level or a greater level. The level of graphics processingmay refer to the collective graphics processing power or ability of oneor more virtual GPUs as measured by any suitable metric(s), such as thenumber of primitives sent to the GPU(s), the number of operationsrequested of the GPU(s), the video memory used by the GPU(s), and/or therate of output from the GPU(s) over a period of time. The second virtualGPU(s) may be selected from a set of virtual GPU classes having variousgraphics processing capabilities. The second virtual GPU(s) may beselected to meet or exceed the requirements, e.g., to match the currentor anticipated graphics workload of the virtual compute instance.Accordingly, the second virtual GPU(s) may be of one or more classesthat are capable of handling the graphics workload with an acceptablelevel of performance. In one embodiment, the elastic graphics servicemay store benchmarks or other metrics for each class of virtual GPU toindicate the graphics processing capabilities relative to various levelsof graphics workload.

In one embodiment, the first set may include a single virtual GPU, andthe second set may include multiple virtual GPUs that may collectivelyprovide a lesser or greater level of graphics processing than the singlevirtual GPU. In one embodiment, the first set may include multiplevirtual GPUs, and the second set may include a single virtual GPU thatmay provide a lesser or greater level of graphics processing than themultiple virtual GPUs. If the second set includes more than one virtualGPU, then the multiple virtual GPUs may typically (but not necessarily)be of the same class. If the first set includes more than one virtualGPU, then any suitable techniques may be used to distribute a workloadamong the multiple virtual GPUs, such as broadcasting input data to allof the virtual GPUs and using the virtual GPUs to operate in aconcurrent manner on different portions of the input data.

The first virtual GPU(s) may be removed from the virtual computeinstance, and the second virtual GPU(s) may be attached to the virtualcompute instance. In one embodiment, the elastic graphics service mayinteract with one or more other services or functionalities of aprovider network, such as a compute virtualization functionality and/orGPU virtualization functionality, to remove the first virtual GPU(s) andattach the second virtual GPU to the instance. The second virtual GPU(s)may be implemented using physical GPU resources (e.g., one or morephysical GPU(s)) of the provider network, potentially including the samephysical GPU resources that implement the first set. The physical GPU(s)may be attached to a different computing device than the computingdevice that provides the CPU resources for the virtual compute instance.The physical GPU(s) may be accessible to the physical compute instanceover a network. The second virtual GPU(s) may be said to be attached tothe virtual compute instance, or the virtual compute instance may besaid to include the second virtual GPU(s). In one embodiment, thephysical GPU(s) may be shared between the second virtual GPU(s) and oneor more additional virtual GPUs (potentially including the first virtualGPU(s)), and the additional virtual GPUs may be attached to additionalvirtual compute instances. In one embodiment, the second virtual GPU(s)may be accessible to the virtual compute instance via an interfacedevice that includes a network interface and a custom hardwareinterface. Via the custom hardware interface, the interface device mayemulate a GPU and appear to the virtual compute instance to include thesecond virtual GPU(s). Via the network interface, the interface devicemay communicate with the physical GPU(s) over the network.

As shown in 1320, graphics processing for the virtual compute instancemay be migrated from the first virtual GPU(s) to the second virtualGPU(s). Migration of graphics processing may represent replacing thegraphics processing provided by the first virtual GPU(s) with thegraphics processing provided by the second virtual GPU(s) with respectto one or more applications. Migration of graphics processing mayinclude discontinuing use of the first virtual GPU(s) for graphicsprocessing and initiating use of the second virtual GPU(s) for graphicsprocessing with respect to one or more applications. In somecircumstances, the migration may be performed at a time when noapplications are using the first virtual GPU(s). More typically, themigration may be initiated during execution of one or more applicationsand while the application(s) are using the first virtual GPU(s). In oneembodiment, the graphics processing may be migrated from the firstvirtual GPU(s) to the second virtual GPU(s) based (at least in part) onthe change in GPU requirements. In one embodiment, the second set ofvirtual GPU(s) may include one or more of the virtual GPU(s) in thefirst set, such that one or more virtual GPU(s) may remain attached tothe virtual compute instance. In one embodiment, the first virtualGPU(s) may be removed from the virtual compute instance and returned toa pool of available virtual GPUs maintained by the provider network.

When applications are using the first virtual GPU(s) when migration isinitiated, the migration may be referred to as live migration. Toimplement live migration, any currently running applications may bepaused, an interface of the application(s) to the first virtual GPU(s)may be replaced by an interface to the second virtual GPU(s), anygraphics instructions and/or data may be transferred to the secondvirtual GPU(s), and then the second virtual GPU(s) may be used to resumethe graphics processing. As discussed above with respect to FIG. 3, anysuitable technique(s) may be used to offload graphics processing from avirtual compute instance to a virtual GPU on a different computingdevice. For example, an API shim may intercept calls to a graphics APIand marshal the calls to an interface device that presents an interfaceto the first virtual GPU(s). Within the interface device or at the APIshim level, an interface to the first virtual GPU(s) may be replaced byan interface to the second virtual GPU(s) such that the graphicsprocessing is migrated seamlessly and transparently with respect to theapplication(s), e.g., without needing to modify or relaunch theapplication(s).

Turning back to FIG. 13, as shown in 1325, the application may beexecuted on the virtual compute instance using the second virtualGPU(s). Execution of the application may include execution ofinstructions on the virtual compute instance (e.g., on the underlyingphysical compute instance) and/or second virtual GPU(s) (e.g., on theunderlying physical GPU(s)). Execution of the application using thesecond virtual GPU(s) may generate virtual GPU output, e.g., outputproduced by executing instructions or otherwise performing tasks on thevirtual GPU(s). The techniques described herein for migration forvirtualized graphics processing may be used with the techniquesdescribed herein for application-specific virtualized graphicsprocessing.

As shown in 1330, the virtual GPU output may be provided to a clientdevice. The virtual GPU output may be provided to the client device fromthe virtual compute instance or virtual GPU. In one embodiment, thevirtual GPU output may be displayed on a display device associated withthe client device. The virtual GPU output may include pixel informationor other graphical data that is displayed on the display device.Execution of the application using the virtual GPU may include graphicsprocessing (e.g., acceleration of three-dimensional graphics processing)for the application using a graphics API.

Placement Optimization for Virtualized Graphics Processing

In some embodiments, the placement of virtual compute instance(s) and/orvirtual GPU(s) may be optimized in a provider network. As used herein,optimization includes improvement (of performance, cost, and so on) evenif the improvement does not achieve an ideal or perfect state. Thephysical compute instance(s) may be used to implement virtual computeinstance(s), and the physical GPU(s) may be used to implement virtualGPU(s) attached to the virtual compute instance(s). Using techniques forplacement optimization, locations of the virtual compute instance(s)and/or virtual GPU(s) may be selected in the provider network (fromamong a set of available physical compute instance(s) and/or physicalGPU(s)) based on any suitable placement criteria. The one or moreplacement criteria may be based (at least in part) on metrics associatedwith maximizing performance, minimizing cost, minimizing energy usage,and/or any other suitable metrics. The placement criteria may also beassociated with network locality. For example, to minimize networklatency and/or network usage, a virtual compute instance and attachedvirtual GPU may be placed in the same rack in the same data center suchthat network communication between the underlying physical computeinstance and physical GPU may not extend beyond a top-of-rack switch orother networking component in the rack. If locations within the samerack are not available, then nearby locations within the same datacenter may be selected for a virtual compute instance and attachedvirtual GPU. Placement may be optimized in this manner not only fornewly provisioned resources but also for migration of a virtual computeinstance and/or attached virtual GPU after their use has begun. Whenscaling is performed for GPU virtualization as discussed above, thelocations of any virtual GPUs may be selected based on placementcriteria, and/or the location of the virtual compute instance may bemoved based on placement criteria.

FIG. 14 illustrates an example system environment for placementoptimization for virtualized graphics processing, including multipleinstance locations and multiple GPU locations in a provider network,according to one embodiment. The provider network 100 may include aplurality of instance locations 1440A-1440N for a plurality of physicalcompute instances 142A-142N. The instance locations 1440A-1440N mayrepresent a plurality of racks, a plurality of data centers, and/or aplurality of geographical regions. Any of the instance locations1440A-1440N may include one or more physical compute instances. Forexample, physical compute instances 142A-142G may be physically locatedat the instance location 1440A, and physical compute instances 142H-142Nmay be physically located at the instance location 1440N.

The provider network 100 may also include a plurality of GPU locations1450A-1450N for a plurality of physical GPUs 152A-152N (e.g., forgraphics servers that include and provide access to the physical GPUs).The GPU locations 1450A-1450N may represent a plurality of racks, aplurality of data centers, and/or a plurality of geographical regions.Any of the GPU locations 1450A-1450N may include one or more physicalGPUs. For example, physical GPUs 152A-152G may be physically located atthe GPU location 1450A, and physical GPUs 152H-152N may be physicallylocated at the GPU location 1450N. Some of the GPU locations may bewithin the same racks, same data centers, and/or same geographicalregions as some of the instance locations. Placement optimization mayoften seek to place virtual compute instances and their attached virtualGPUs within the same rack or otherwise near each other to minimizelatency.

As discussed above, the elastic graphics service 110 may include aninstance type selection functionality 120. Using the instance typeselection functionality 120, an instance type for a virtual computeinstance may be selected for a client. Using the instance type selectionfunctionality 120, a virtual GPU class for a virtual GPU may also beselected for a client. As discussed above, the instance provisioningfunctionality 130 may provision a virtual compute instance with anattached virtual GPUs of the selected instance type and virtual GPUclass. Using the placement optimization techniques described herein, thelocation of a virtual compute instance and/or virtual GPU may beselected in a provider network based on one or more placement criteria.

The elastic graphics service may include a location selectionfunctionality 1420 that performs location optimization for resources inthe provider network 100. Using the location selection functionality1420, a particular one of the GPU locations 1450A-1450N may be selectedfor a physical GPU that implements a virtual GPU. The GPU location maybe selected based (at least in part) on one or more placement criteria1425. Using the location selection functionality 1420, a particular oneof the instance locations 1440A-1440N may be selected for a physicalcompute instance that implements a virtual compute instance. Theinstance location may also be selected based (at least in part) on oneor more placement criteria 1425.

FIG. 15 illustrates further aspects of the example system environmentfor placement optimization for virtualized graphics processing,including resource provisioning with a selected instance location and aselected GPU location in a provider network, according to oneembodiment. Based on one or more of the placement criteria 1425, aparticular GPU location 1450A may be selected for a physical GPU 152A.Based on one or more of the placement criteria 1425, a particularinstance location 1440A may be selected for a physical compute instance141B. The placement criteria used to select the GPU location may be thesame criteria or different criteria as the placement criteria used toselect the instance location. In one embodiment, both the instancelocation and the GPU location may be optimized for a particular virtualcompute instance and its attached virtual GPU. In one embodiment, theplacement criteria used to optimize the placement of a particularvirtual compute instance and/or virtual GPU may be provided or approvedby a client of the provider network. In one embodiment, the placementcriteria used to optimize the placement of a particular virtual computeinstance and/or virtual GPU may be provided or approved by anadministrator of the provider network. In one embodiment, the placementcriteria used to optimize the placement of a particular virtual computeinstance and/or virtual GPU may be determined using a defaultconfiguration.

The one or more placement criteria 1425 may include or be associatedwith optimization (e.g., improvement) of metrics for performance (e.g.,to maximize performance), resource usage (e.g., to minimize resourceusage), cost (e.g., to minimize cost or fit resource costs within aclient-specified budget), energy usage (e.g., to minimize energy usageor prioritize “green” energy), network locality (e.g., to minimizenetworking proximity between two or more resources), and/or any othersuitable metrics. Performance metrics and cost metrics used as placementcriteria may often be associated with the use of the physical GPU by thephysical compute instance. Performance metrics may includenetwork-related metrics such as latency and bandwidth, as measuredwithin the provider network and/or between the provider network and aclient device. Performance metrics may include any other metrics relatedto processor use, GPU use, memory use, storage use, and so on. As anexample, to minimize network latency and/or bandwidth, an instancelocation 1440A for a physical compute instance 142A may be selectedwithin the same rack as the physical GPU 152A such that networkcommunication between the underlying physical compute instance andphysical GPU may not extend beyond a top-of-rack switch in the rack. Iflocations within the same rack are not available, then an instancelocation nearby the physical GPU (e.g., within the same data center) maybe selected to optimize the placement criteria. As another example, aGPU location 1450A in a data center nearest the client device 180A maybe selected to minimize latency between the physical GPU and the clientdevice, where the proximity of the data center to the client device ismeasured based on anticipated or historical latency and/or ongeographical proximity.

Using the instance provisioning functionality 130, a virtual GPU 151Bmay be provisioned using the physical GPU 152A in the selected GPUlocation 1450A. The virtual GPU 151B may be selected from a set ofvirtual GPU classes having various graphics processing capabilities. Thevirtual GPU may be selected to meet or exceed any applicable GPUrequirements, e.g., to match the current or anticipated graphicsworkload of the virtual compute instance. Using the instanceprovisioning functionality 130, a virtual compute instance 141B may beprovisioned using the physical compute instance 142A in the selectedinstance location 1440A. As used herein, provisioning a virtual computeinstance generally includes reserving resources (e.g., computational andmemory resources) of an underlying physical compute instance for theclient (e.g., from a pool of available physical compute instances andother resources), installing or launching required software (e.g., anoperating system), and making the virtual compute instance available tothe client for performing tasks specified by the client. The virtualcompute instance may be selected from a plurality of instance typeshaving various capabilities.

Placement optimization for network locality may attempt to groupmultiple resources (e.g., one or more physical compute instances and oneor more physical GPUs) based (at least in part) on proximity within anetwork. Network locality may refer to one or more locations,connections, associations, or zones in a network to which a resourcebelongs. A resource itself may be a node or particular network location(e.g., network address) and thus a network locality. Network localitymay be determined based on the network router, switch, or other networkdevice or infrastructure (e.g., network spine) to which a resource isconnected. Network localities may be logically determined according tologically associated network devices or resource in some embodiments. Aresource may belong to multiple network localities, such as beingconnected to a particular network router, which may be in turn linked toother network routers, or networking devices. Instance locations and/orGPU locations may be selected based (at least in part) on networklocality.

FIG. 16A illustrates an example of multiple instance locations andmultiple GPU locations in different racks in a provider network,according to one embodiment. As discussed above, the provider network100 may include a plurality of instance locations 1440A-1440N for aplurality of physical compute instances 142A-142N and also include aplurality of GPU locations 1450A-1450N for a plurality of physical GPUs152A-152N (e.g., for graphics servers that include and provide access tothe physical GPUs). In one embodiment, the provider network 100 mayinclude a plurality of racks 1600A-1600N in one or more data centers orgeographical locations. Any of the racks 1600A-1600N may include one ormore instance locations and also one or more GPU locations. As shown inthe example of FIG. 16A, rack 1600A may include physical computeinstances 142A-142G at the instance location 1440A, and rack 1600A mayalso include physical GPUs 152A-152G at the GPU location 1450A.Similarly, rack 1600N may include physical compute instances 142H-142Nat the instance location 1440N, and rack 1600N may also include physicalGPUs 152H-152N at the GPU location 1450N.

Each rack may have a networking component such as a top-of-rack switch(such as switch 1610A for rack 1600A and switch 1610N for rack 1600A).The top-of-rack switches 1610A-1610N may mediate network communicationfor components within the corresponding rack and provide a networkconnection to other portions of the network beyond the rack. When thevirtual compute instance 141B communicates with the attached virtual GPU151B, data sent between the underlying physical compute instance 142Aand the underlying physical GPU 152A may not go beyond the switch 1610A.Accordingly, to optimize for network locality, placement optimizationmay often seek to place virtual compute instances and their attachedvirtual GPUs within the same rack or otherwise near each other in a datacenter to minimize latency and/or minimize network bandwidth beyond therack.

FIG. 16B illustrates an example of multiple instance locations andmultiple GPU locations in different data centers in a provider network,according to one embodiment. As discussed above, the provider network100 may include a plurality of instance locations 1440A-1440N for aplurality of physical compute instances 142A-142N and also include aplurality of GPU locations 1450A-1450N for a plurality of physical GPUs152A-152N (e.g., for graphics servers that include and provide access tothe physical GPUs). In one embodiment, the provider network 100 mayinclude a plurality of data centers 1620A-1620N in one or moregeographical locations. Each of the data centers 1620A-1620N mayrepresent a set of computing resources, processing resources, storageresources, memory resources, and so on at a single facility orgeographically proximate set of facilities. Any of the data centers1620A-1620N may include one or more instance locations and also one ormore GPU locations. As shown in the example of FIG. 16B, data center1620A may include physical compute instances 142A-142G at the instancelocation 1440A, and data center 1620A may also include physical GPUs152A-152G at the GPU location 1450A. Similarly, data center 1620N mayinclude physical compute instances 142H-142N at the instance location1440N, and data center 1620N may also include physical GPUs 152H-152N atthe GPU location 1450N. The data centers 1620A-1620N may vary in theirproximity to various client devices. To optimize for network locality,placement optimization may seek to place a virtual compute instanceand/or its attached virtual GPU in a data center based on proximity to aparticular client device to minimize latency with respect to that clientdevice.

FIG. 17A is a flowchart illustrating a method for placement optimizationfor virtualized graphics processing, including location selection for aphysical GPU used to implement a virtual GPU, according to oneembodiment. As shown in 1705, a virtual compute instance may beprovisioned using a physical compute instance in a provider network. Theprovider network may include a plurality of instance locations for aplurality of physical compute instances. For example, the instancelocations may include a plurality of racks, a plurality of data centers,and/or a plurality of geographical regions. The virtual compute instancemay be provisioned in a particular one of these instance locations.

The method may optimize placement of a virtual GPU to be used with thevirtual compute instance. As used herein, optimization includesimprovement (of performance, cost, and so on) even if the improvementdoes not achieve an ideal or perfect state. The provider network mayalso include a plurality of GPU locations for a plurality of physicalGPUs (e.g., for graphics servers that include and provide access to thephysical GPUs). For example, the GPU locations may include a pluralityof racks, a plurality of data centers, and/or a plurality ofgeographical regions. Some of the GPU locations may be within the sameracks, same data centers, and/or same geographical regions as some ofthe instance locations. Placement optimization may often seek to placevirtual compute instances and their attached virtual GPUs within thesame rack or otherwise near each other to minimize latency.

As shown in 1710, a particular one of these GPU locations may beselected for a physical GPU. The GPU location may be selected based (atleast in part) on one or more placement criteria. The one or moreplacement criteria may include optimization (e.g., improvement) ofmetrics for performance (e.g., to maximize performance), resource usage(e.g., to minimize resource usage), cost (e.g., to minimize cost or fitresource costs within a client-specified budget), energy usage (e.g., tominimize energy usage or prioritize “green” energy), and/or any othersuitable metrics. Performance metrics and cost metrics used as placementcriteria may often be associated with the use of the physical GPU by thephysical compute instance. Performance metrics may includenetwork-related metrics such as latency and bandwidth, as measuredwithin the provider network and/or between the provider network and aclient device. Performance metrics may include any other metrics relatedto processor use, GPU use, memory use, storage use, and so on. As anexample, to minimize network latency and/or bandwidth, a GPU locationfor a physical GPU may be selected within the same rack as the physicalcompute instance such that network communication between the underlyingphysical compute instance and physical GPU may not extend beyond atop-of-rack switch in the rack. If locations within the same rack arenot available, then a GPU location nearby the physical compute instance(e.g., within the same data center) may be selected to optimize theplacement criteria. As another example, a GPU location in a data centernearest the client device may be selected to minimize latency betweenthe physical GPU and the client device, where the proximity of the datacenter to the client device is measured based on anticipated orhistorical latency and/or on geographical proximity.

As shown in 1715, a virtual GPU may be provisioned using the physicalGPU in the selected GPU location. The virtual GPU may be selected from aset of virtual GPU classes having various graphics processingcapabilities. The virtual GPU may be selected to meet or exceed anyapplicable GPU requirements, e.g., to match the current or anticipatedgraphics workload of the virtual compute instance.

As shown in 1720, the virtual GPU may be attached to the virtual computeinstance. In one embodiment, an elastic graphics service may interactwith one or more other services or functionalities of a providernetwork, such as a compute virtualization functionality and/or GPUvirtualization functionality, to attach the virtual GPU to the instance.The physical GPU used to implement the virtual GPU may be attached to adifferent computing device than the computing device that provides theCPU resources for the virtual compute instance. The physical GPU may beaccessible to the physical compute instance over a network. The virtualGPU may be said to be attached to the virtual compute instance, or thevirtual compute instance may be said to include the virtual GPU. In oneembodiment, the physical GPU may be shared between the virtual GPU andone or more additional virtual GPUs, and the additional virtual GPUs maybe attached to additional virtual compute instances. In one embodiment,the virtual GPU may be accessible to the virtual compute instance via aninterface device that includes a network interface and a custom hardwareinterface. Via the custom hardware interface, the interface device mayemulate a GPU and appear to the virtual compute instance to include thevirtual GPU. Via the network interface, the interface device maycommunicate with the physical GPU over the network.

In one embodiment, a different virtual GPU may have been attached to thevirtual compute instance prior to the provisioning and attachment of thevirtual GPU as shown in 1715 and 1720. The newly attached virtual GPUmay represent an improvement in the one or more placement criteria withrespect to the previously attached virtual GPU. Graphics processing forthe virtual compute instance may be migrated from the previouslyattached virtual GPU to the newly attached virtual GPU using themigration techniques discussed above.

As shown in 1725, an application may be executed on the virtual computeinstance using the virtual GPU. Execution of the application may includeexecution of instructions on the virtual compute instance (e.g., on theunderlying physical compute instance) and/or virtual GPU (e.g., on theunderlying physical GPU). Execution of the application using the virtualGPU may generate virtual GPU output, e.g., output produced by executinginstructions or otherwise performing tasks on the virtual GPU.

As shown in 1730, the virtual GPU output may be provided to a clientdevice. The virtual GPU output may be provided to the client device fromthe virtual compute instance or virtual GPU. In one embodiment, thevirtual GPU output may be displayed on a display device associated withthe client device. The virtual GPU output may include pixel informationor other graphical data that is displayed on the display device.Execution of the application using the virtual GPU may include graphicsprocessing (e.g., acceleration of three-dimensional graphics processing)for the application using a graphics API.

FIG. 17B is a flowchart illustrating a method for placement optimizationfor virtualized graphics processing, including location selection for aphysical compute instance used to implement a virtual compute instance,according to one embodiment. As shown in 1706, a virtual GPU may beprovisioned using a physical GPU in a provider network. The providernetwork may include a plurality of GPU locations for a plurality ofphysical GPUs. For example, the GPU locations may include a plurality ofracks, a plurality of data centers, and/or a plurality of geographicalregions. The virtual GPU may be provisioned in a particular one of theseGPU locations. The virtual GPU may be selected from a set of virtual GPUclasses having various graphics processing capabilities. The virtual GPUmay be selected to meet or exceed any applicable GPU requirements, e.g.,to match the current or anticipated graphics workload of the virtualcompute instance.

The method may optimize placement of a virtual compute instance to beused with the virtual GPU. As used herein, optimization includesimprovement (of performance, cost, and so on) even if the improvementdoes not achieve an ideal or perfect state. The provider network mayalso include a plurality of instance locations for a plurality ofphysical compute instances. For example, the instance locations mayinclude a plurality of racks, a plurality of data centers, and/or aplurality of geographical regions. Some of the instance locations may bewithin the same racks, same data centers, and/or same geographicalregions as some of the GPU locations. Placement optimization may oftenseek to place virtual compute instances and their attached virtual GPUswithin the same rack or otherwise near each other to minimize latency.

As shown in 1711, a particular one of these instance locations may beselected for a physical compute instance. The instance location may beselected based (at least in part) on one or more placement criteria. Theone or more placement criteria may include optimization (e.g.,improvement) of metrics for performance (e.g., to maximize performance),resource usage (e.g., to minimize resource usage), cost (e.g., tominimize cost or fit resource costs within a client-specified budget),energy usage (e.g., to minimize energy usage or prioritize “green”energy), and/or any other suitable metrics. Performance metrics and costmetrics used as placement criteria may often be associated with the useof the physical GPU by the physical compute instance. Performancemetrics may include network-related metrics such as latency andbandwidth, as measured within the provider network and/or between theprovider network and a client device. Performance metrics may includeany other metrics related to processor use, GPU use, memory use, storageuse, and so on. As an example, to minimize network latency and/orbandwidth, an instance location for a physical compute instance may beselected within the same rack as the physical GPU such that networkcommunication between the underlying physical compute instance andphysical GPU may not extend beyond a top-of-rack switch in the rack. Iflocations within the same rack are not available, then an instancelocation nearby the physical GPU (e.g., within the same data center) maybe selected to optimize the placement criteria. As another example, aninstance location in a data center nearest the client device may beselected to minimize latency between the physical compute instance andthe client device, where the proximity of the data center to the clientdevice is measured based on anticipated or historical latency and/or ongeographical proximity.

As shown in 1716, a virtual compute instance may be provisioned usingthe physical compute instance in the selected instance location. As usedherein, provisioning a virtual compute instance generally includesreserving resources (e.g., computational and memory resources) of anunderlying physical compute instance for the client (e.g., from a poolof available physical compute instances and other resources), installingor launching required software (e.g., an operating system), and makingthe virtual compute instance available to the client for performingtasks specified by the client. The virtual compute instance may beselected from a plurality of instance types having various capabilities.

As shown in 1720, the virtual GPU may be attached to the virtual computeinstance. In one embodiment, an elastic graphics service may interactwith one or more other services or functionalities of a providernetwork, such as a compute virtualization functionality and/or GPUvirtualization functionality, to attach the virtual GPU to the instance.The physical GPU used to implement the virtual GPU may be attached to adifferent computing device than the computing device that provides theCPU resources for the virtual compute instance. The physical GPU may beaccessible to the physical compute instance over a network. The virtualGPU may be said to be attached to the virtual compute instance, or thevirtual compute instance may be said to include the virtual GPU. In oneembodiment, the physical GPU may be shared between the virtual GPU andone or more additional virtual GPUs, and the additional virtual GPUs maybe attached to additional virtual compute instances. In one embodiment,the virtual GPU may be accessible to the virtual compute instance via aninterface device that includes a network interface and a custom hardwareinterface. Via the custom hardware interface, the interface device mayemulate a GPU and appear to the virtual compute instance to include thevirtual GPU. Via the network interface, the interface device maycommunicate with the physical GPU over the network.

As shown in 1725, an application may be executed on the virtual computeinstance using the virtual GPU. Execution of the application may includeexecution of instructions on the virtual compute instance (e.g., on theunderlying physical compute instance) and/or virtual GPU (e.g., on theunderlying physical GPU). Execution of the application using the virtualGPU may generate virtual GPU output, e.g., output produced by executinginstructions or otherwise performing tasks on the virtual GPU.

As shown in 1730, the virtual GPU output may be provided to a clientdevice. The virtual GPU output may be provided to the client device fromthe virtual compute instance or virtual GPU. In one embodiment, thevirtual GPU output may be displayed on a display device associated withthe client device. The virtual GPU output may include pixel informationor other graphical data that is displayed on the display device.Execution of the application using the virtual GPU may include graphicsprocessing (e.g., acceleration of three-dimensional graphics processing)for the application using a graphics API.

FIG. 17C is a flowchart illustrating a method for placement optimizationfor virtualized graphics processing, including location selection for aphysical GPU used to implement a virtual GPU and location selection fora physical compute instance used to implement a virtual computeinstance, according to one embodiment. The method may optimize placementof a virtual GPU as well as placement of a virtual compute instance towhich the virtual GPU is attached. As used herein, optimization includesimprovement (of performance, cost, and so on) even if the improvementdoes not achieve an ideal or perfect state. A provider network mayinclude a plurality of GPU locations for a plurality of physical GPUs(e.g., for graphics servers that include and provide access to thephysical GPUs). For example, the GPU locations may include a pluralityof racks, a plurality of data centers, and/or a plurality ofgeographical regions. The provider network may also include a pluralityof instance locations for a plurality of physical compute instances. Theinstance locations may include a plurality of racks, a plurality of datacenters, and/or a plurality of geographical regions. Some of the GPUlocations may be within the same racks, same data centers, and/or samegeographical regions as some of the instance locations. Placementoptimization may often seek to place virtual compute instances and theirattached virtual GPUs within the same rack or otherwise near each otherto minimize latency.

As shown in 1710, a particular one of the GPU locations may be selectedfor a physical GPU. The GPU location may be selected based (at least inpart) on one or more placement criteria. The one or more placementcriteria may include optimization (e.g., improvement) of metrics forperformance (e.g., to maximize performance), resource usage (e.g., tominimize resource usage), cost (e.g., to minimize cost or fit resourcecosts within a client-specified budget), energy usage (e.g., to minimizeenergy usage or prioritize “green” energy), and/or any other suitablemetrics. Performance metrics and cost metrics used as placement criteriamay often be associated with the use of the physical GPU by the physicalcompute instance. Performance metrics may include network-relatedmetrics such as latency and bandwidth, as measured within the providernetwork and/or between the provider network and a client device.Performance metrics may include any other metrics related to processoruse, GPU use, memory use, storage use, and so on. As an example, tominimize network latency and/or bandwidth, a GPU location for a physicalGPU may be selected within the same rack as the physical computeinstance such that network communication between the underlying physicalcompute instance and physical GPU may not extend beyond a top-of-rackswitch in the rack. If locations within the same rack are not available,then a GPU location nearby the physical compute instance (e.g., withinthe same data center) may be selected to optimize the placementcriteria. As another example, a GPU location in a data center nearestthe client device may be selected to minimize latency between thephysical GPU and the client device, where the proximity of the datacenter to the client device is measured based on anticipated orhistorical latency and/or on geographical proximity.

As shown in 1711, a particular one of the instance locations may beselected for a physical compute instance. The instance location may beselected based (at least in part) on one or more placement criteria.Again, the one or more placement criteria may include optimization(e.g., improvement) of metrics for performance (e.g., to maximizeperformance), resource usage (e.g., to minimize resource usage), cost(e.g., to minimize cost or fit resource costs within a client-specifiedbudget), energy usage (e.g., to minimize energy usage or prioritize“green” energy), and/or any other suitable metrics. As an example, tominimize network latency and/or bandwidth, an instance location for aphysical compute instance may be selected within the same rack as thephysical GPU such that network communication between the underlyingphysical compute instance and physical GPU may not extend beyond atop-of-rack switch in the rack. If locations within the same rack arenot available, then an instance location nearby the physical GPU (e.g.,within the same data center) may be selected to optimize the placementcriteria. As another example, an instance location in a data centernearest the client device may be selected to minimize latency betweenthe physical compute instance and the client device, where the proximityof the data center to the client device is measured based on anticipatedor historical latency and/or on geographical proximity.

As shown in 1715, a virtual GPU may be provisioned using the physicalGPU in the selected GPU location. The virtual GPU may be selected from aset of virtual GPU classes having various graphics processingcapabilities. The virtual GPU may be selected to meet or exceed anyapplicable GPU requirements, e.g., to match the current or anticipatedgraphics workload of the virtual compute instance.

As shown in 1716, a virtual compute instance may be provisioned usingthe physical compute instance in the selected instance location. As usedherein, provisioning a virtual compute instance generally includesreserving resources (e.g., computational and memory resources) of anunderlying physical compute instance for the client (e.g., from a poolof available physical compute instances and other resources), installingor launching required software (e.g., an operating system), and makingthe virtual compute instance available to the client for performingtasks specified by the client. The virtual compute instance may beselected from a plurality of instance types having various capabilities.

As shown in 1720, the virtual GPU may be attached to the virtual computeinstance. In one embodiment, an elastic graphics service may interactwith one or more other services or functionalities of a providernetwork, such as a compute virtualization functionality and/or GPUvirtualization functionality, to attach the virtual GPU to the instance.The physical GPU used to implement the virtual GPU may be attached to adifferent computing device than the computing device that provides theCPU resources for the virtual compute instance. The physical GPU may beaccessible to the physical compute instance over a network. The virtualGPU may be said to be attached to the virtual compute instance, or thevirtual compute instance may be said to include the virtual GPU. In oneembodiment, the physical GPU may be shared between the virtual GPU andone or more additional virtual GPUs, and the additional virtual GPUs maybe attached to additional virtual compute instances. In one embodiment,the virtual GPU may be accessible to the virtual compute instance via aninterface device that includes a network interface and a custom hardwareinterface. Via the custom hardware interface, the interface device mayemulate a GPU and appear to the virtual compute instance to include thevirtual GPU. Via the network interface, the interface device maycommunicate with the physical GPU over the network.

In one embodiment, a different virtual GPU may have been attached to thevirtual compute instance prior to the provisioning and attachment of thevirtual GPU as shown in 1715 and 1720. The newly attached virtual GPUmay represent an improvement in the one or more placement criteria withrespect to the previously attached virtual GPU. Graphics processing forthe virtual compute instance may be migrated from the previouslyattached virtual GPU to the newly attached virtual GPU using themigration techniques discussed above.

As shown in 1725, an application may be executed on the virtual computeinstance using the virtual GPU. Execution of the application may includeexecution of instructions on the virtual compute instance (e.g., on theunderlying physical compute instance) and/or virtual GPU (e.g., on theunderlying physical GPU). Execution of the application using the virtualGPU may generate virtual GPU output, e.g., output produced by executinginstructions or otherwise performing tasks on the virtual GPU.

As shown in 1730, the virtual GPU output may be provided to a clientdevice. The virtual GPU output may be provided to the client device fromthe virtual compute instance or virtual GPU. In one embodiment, thevirtual GPU output may be displayed on a display device associated withthe client device. The virtual GPU output may include pixel informationor other graphical data that is displayed on the display device.Execution of the application using the virtual GPU may include graphicsprocessing (e.g., acceleration of three-dimensional graphics processing)for the application using a graphics API.

Placement criteria may be optimized in this manner not only for newlyprovisioned resources but also for migration of a virtual computeinstance and/or attached virtual GPU after their use has begun. Whenscaling is performed for GPU virtualization as discussed above, thelocations of any virtual GPUs may be selected based on placementcriteria, and/or the location of the virtual compute instance may bemoved based on placement criteria. For example, if a virtual GPU isinsufficient to meet the GPU requirements of a virtual compute instance,both the virtual GPU and the virtual compute instance may be moved to adifferent set of locations where a virtual GPU of a sufficiently capableclass can be provisioned. Similarly, if a virtual compute instance needsto be migrated to a different location, the location of an attachedvirtual GPU may be migrated as well to optimize one or more placementcriteria. If the resource requirements for the instance type and/or GPUclass change over time (based on user input and/or performancemonitoring), either the virtual compute instance and/or attached virtualGPU (and often both) may be migrated to new locations for optimizationof placement criteria. If resource availability changes over time,either the virtual compute instance and/or attached virtual GPU (andoften both) may be migrated to new locations for optimization ofplacement criteria. If resource costs change over time, either thevirtual compute instance and/or attached virtual GPU (and often both)may be migrated to new locations for optimization of placement criteria.

In one embodiment, migration of resources such as virtual computeinstances and/or virtual GPUs may be performed based on placementscoring. A placement score for a current placement of a resource at aresource host may be generated with respect to one or more placementcriteria. The placement criteria, as discussed above, may be used tooptimize placement of resources in the provider network 100. Forexample, placement criteria may include configuration of the resourcealong with other resources if part of a distributed resource, availablebytes, input/output operations per second (IOPs), or slots, a resourceutilization balance, such as bytes to IOPs balance, impact on capacityfragmentation, hardware/software characteristics, and/or various desiredlocation-based configurations. It may be optimal to place a resourcesuch as a virtual GPU in the same infrastructure zone (e.g., connectedto the same network router) as a related resource such as a virtualcompute instance. The placement score may reflect a score on how closethe current placement is with respect to the more optimal scenario(e.g., same network router). The score may be a composite of multipledifferent placement criteria, considering the impact on the resource,resource host, and/or distributed system as a whole.

Resource hosts such as physical compute instances and graphics servers(that host physical GPUs) may be evaluated to determine those resourcehosts that can host a resource such as a virtual compute instance or avirtual GPU. For instance, hosts that do not satisfy certain conditionsmay be filtered out of consideration. Such conditions may include, butare not limited to logical groups (e.g., identifying a particular serverpool in which the resource is to be placed), capability or capacity tohost the resource (e.g., sufficient bytes to store data, sufficient IOPbandwidth, appropriate hardware and/or software installed, etc.),location or diversity constraints (e.g., a resource that is part of adistributed resource cannot be placed on a resource host at the sameserver rack as another resource host hosting another resource of thedistributed resource), and/or explicitly excluded resource hosts (e.g.,a black list). The remaining available resource hosts that can host theresource may then be evaluated as potential destination hosts. Forexample, placement score(s) may be generated for the placement of theresource at possible destination resource host(s). In at least someembodiments, a subset of available resource hosts may have scoresgenerated as a possible placement, while in other embodiments allavailable resource hosts may be considered by generating a placementscores.

A difference between the placement score of the current placement of theresource and the scores of the possible placements may be determined andcompared to an optimization threshold. For example, the difference maybe a value which is compared to a threshold value (is difference >0.3).If the difference of any of the possible placements does not exceed theoptimization threshold, then another resource may be selected toevaluate. However, if the difference of any placement exceeds theresource, then the resource may be identified as a candidate resourcefor migration. The possible destination that created the largestdifference may be identified as the destination host (if more than onedestination host was evaluated).

In at least some embodiments, a priority for performing the migration ofthe resource to the destination resource host may be assigned. Priorityfactors may be used to score, weight, generate or otherwise indicate theassigned priority. For example, priority factors may include thedifference value between current and possible destination (e.g., tofavor performing those migrations that make larger improvements),resource age or history (e.g., newer resources are less likely to existas long and therefore migrations may not be as important), size or costto perform the migration (e.g., delay migration if resource is acomplicated component or service or other resource-intensive migration),and/or local network state (e.g., to delay migration operations frombeing performed in locations within a distributed system that might beunder network or other resource constraints because of foregroundprocessing, such as serving client requests). These factors, along withothers, may be weighted, combined, ordered, or selectively applied todetermine a priority for the migration operation.

Illustrative Computer System

In at least some embodiments, a computer system that implements aportion or all of one or more of the technologies described herein mayinclude a computer system that includes or is configured to access oneor more computer-readable media. FIG. 18 illustrates such a computingdevice 3000. In the illustrated embodiment, computing device 3000includes one or more processors 3010 coupled to a system memory 3020 viaan input/output (I/O) interface 3030. Computing device 3000 furtherincludes a network interface 3040 coupled to I/O interface 3030.

In various embodiments, computing device 3000 may be a uniprocessorsystem including one processor 3010 or a multiprocessor system includingseveral processors 3010 (e.g., two, four, eight, or another suitablenumber). Processors 3010 may include any suitable processors capable ofexecuting instructions. For example, in various embodiments, processors3010 may be processors implementing any of a variety of instruction setarchitectures (ISAs), such as the x86, PowerPC, SPARC, or MIPS ISAs, orany other suitable ISA. In multiprocessor systems, each of processors3010 may commonly, but not necessarily, implement the same ISA.

System memory 3020 may be configured to store program instructions anddata accessible by processor(s) 3010. In various embodiments, systemmemory 3020 may be implemented using any suitable memory technology,such as static random access memory (SRAM), synchronous dynamic RAM(SDRAM), nonvolatile/Flash-type memory, or any other type of memory. Inthe illustrated embodiment, program instructions and data implementingone or more desired functions, such as those methods, techniques, anddata described above, are shown stored within system memory 3020 as code(i.e., program instructions) 3025 and data 3026.

In one embodiment, I/O interface 3030 may be configured to coordinateI/O traffic between processor 3010, system memory 3020, and anyperipheral devices in the device, including network interface 3040 orother peripheral interfaces. In some embodiments, I/O interface 3030 mayperform any necessary protocol, timing or other data transformations toconvert data signals from one component (e.g., system memory 3020) intoa format suitable for use by another component (e.g., processor 3010).In some embodiments, I/O interface 3030 may include support for devicesattached through various types of peripheral buses, such as a variant ofthe Peripheral Component Interconnect (PCI) bus standard or theUniversal Serial Bus (USB) standard, for example. In some embodiments,the function of I/O interface 3030 may be split into two or moreseparate components, such as a north bridge and a south bridge, forexample. Also, in some embodiments some or all of the functionality ofI/O interface 3030, such as an interface to system memory 3020, may beincorporated directly into processor 3010.

Network interface 3040 may be configured to allow data to be exchangedbetween computing device 3000 and other devices 3060 attached to anetwork or networks 3050. In various embodiments, network interface 3040may support communication via any suitable wired or wireless generaldata networks, such as types of Ethernet network, for example.Additionally, network interface 3040 may support communication viatelecommunications/telephony networks such as analog voice networks ordigital fiber communications networks, via storage area networks such asFibre Channel SANs, or via any other suitable type of network and/orprotocol.

In some embodiments, system memory 3020 may be one embodiment of acomputer-readable (i.e., computer-accessible) medium configured to storeprogram instructions and data as described above for implementingembodiments of the corresponding methods and apparatus. However, inother embodiments, program instructions and/or data may be received,sent or stored upon different types of computer-readable media.Generally speaking, a computer-readable medium may includenon-transitory storage media or memory media such as magnetic or opticalmedia, e.g., disk or DVD/CD coupled to computing device 3000 via I/Ointerface 3030. A non-transitory computer-readable storage medium mayalso include any volatile or non-volatile media such as RAM (e.g. SDRAM,DDR SDRAM, RDRAM, SRAM, etc.), ROM, etc., that may be included in someembodiments of computing device 3000 as system memory 3020 or anothertype of memory. Further, a computer-readable medium may includetransmission media or signals such as electrical, electromagnetic, ordigital signals, conveyed via a communication medium such as a networkand/or a wireless link, such as may be implemented via network interface3040. Portions or all of multiple computing devices such as thatillustrated in FIG. 18 may be used to implement the describedfunctionality in various embodiments; for example, software componentsrunning on a variety of different devices and servers may collaborate toprovide the functionality. In some embodiments, portions of thedescribed functionality may be implemented using storage devices,network devices, or various types of computer systems. The term“computing device,” as used herein, refers to at least all these typesof devices, and is not limited to these types of devices.

The various methods as illustrated in the Figures and described hereinrepresent examples of embodiments of methods. The methods may beimplemented in software, hardware, or a combination thereof. In variousones of the methods, the order of the steps may be changed, and variouselements may be added, reordered, combined, omitted, modified, etc.Various ones of the steps may be performed automatically (e.g., withoutbeing directly prompted by user input) and/or programmatically (e.g.,according to program instructions).

The terminology used in the description of the invention herein is forthe purpose of describing particular embodiments only and is notintended to be limiting of the invention. As used in the description ofthe invention and the appended claims, the singular forms “a”, “an” and“the” are intended to include the plural forms as well, unless thecontext clearly indicates otherwise. It will also be understood that theterm “and/or” as used herein refers to and encompasses any and allpossible combinations of one or more of the associated listed items. Itwill be further understood that the terms “includes,” “including,”“comprises,” and/or “comprising,” when used in this specification,specify the presence of stated features, integers, steps, operations,elements, and/or components, but do not preclude the presence oraddition of one or more other features, integers, steps, operations,elements, components, and/or groups thereof

As used herein, the term “if” may be construed to mean “when” or “upon”or “in response to determining” or “in response to detecting,” dependingon the context. Similarly, the phrase “if it is determined” or “if [astated condition or event] is detected” may be construed to mean “upondetermining” or “in response to determining” or “upon detecting [thestated condition or event]” or “in response to detecting [the statedcondition or event],” depending on the context.

It will also be understood that, although the terms first, second, etc.,may be used herein to describe various elements, these elements shouldnot be limited by these terms. These terms are only used to distinguishone element from another. For example, a first contact could be termed asecond contact, and, similarly, a second contact could be termed a firstcontact, without departing from the scope of the present invention. Thefirst contact and the second contact are both contacts, but they are notthe same contact.

Numerous specific details are set forth herein to provide a thoroughunderstanding of claimed subject matter. However, it will be understoodby those skilled in the art that claimed subject matter may be practicedwithout these specific details. In other instances, methods, apparatus,or systems that would be known by one of ordinary skill have not beendescribed in detail so as not to obscure claimed subject matter. Variousmodifications and changes may be made as would be obvious to a personskilled in the art having the benefit of this disclosure. It is intendedto embrace all such modifications and changes and, accordingly, theabove description is to be regarded in an illustrative rather than arestrictive sense.

What is claimed is:
 1. A system, comprising: a virtual compute instance,wherein a virtual graphics processing unit (GPU) is attached to thevirtual compute instance, wherein the virtual compute instance isimplemented using central processing unit (CPU) resources and memoryresources of a physical compute instance, wherein the virtual GPU isimplemented using a physical GPU accessible to the physical computeinstance over a network, wherein the virtual compute instance isprovided by a multi-tenant provider network, and wherein themulti-tenant provider network comprises a plurality of instancelocations for physical compute instances and a plurality of GPUlocations for physical GPUs; and one or more computing devicesconfigured to implement an elastic graphics service, wherein the elasticgraphics service is configured to: select, in the multi-tenant providernetwork, a GPU location for the physical GPU or an instance location forthe physical compute instance based at least in part on one or moreplacement criteria for optimization of placement, wherein the placementcriteria are associated with use of the physical GPU by the physicalcompute instance; and cause the physical GPU to be provisioned in theGPU location or the physical compute instance to be provisioned in theinstance location; and wherein the virtual compute instance isconfigured to: execute an application using the virtual GPU.
 2. Thesystem as recited in claim 1, wherein the one or more placement criteriaare based at least in part on a performance metric associated with theuse of the physical GPU by the physical compute instance.
 3. The systemas recited in claim 1, wherein the one or more placement criteria arebased at least in part on a cost metric associated with the use of thephysical GPU by the physical compute instance.
 4. The system as recitedin claim 1, wherein the GPU location or the instance location isselected based at least in part on network locality.
 5. Acomputer-implemented method, comprising: selecting, in a multi-tenantprovider network, a graphics processing unit (GPU) location for aphysical GPU or an instance location for a physical compute instancebased at least in part on one or more placement criteria, wherein themulti-tenant provider network comprises a plurality of instancelocations for physical compute instances and a plurality of GPUlocations for physical GPUs; provisioning a virtual compute instance anda virtual GPU attached to the virtual compute instance, wherein thevirtual compute instance is implemented using the physical computeinstance in the instance location, wherein the virtual GPU isimplemented using the physical GPU in the GPU location, and wherein thephysical GPU is accessible to the physical compute instance over anetwork; and executing an application using the virtual GPU on thevirtual compute instance.
 6. The method as recited in claim 5, whereinthe one or more placement criteria comprise improvement of one or moremetrics.
 7. The method as recited in claim 5, wherein the one or moreplacement criteria are based at least in part on a performance metricassociated with use of the physical GPU by the physical computeinstance.
 8. The method as recited in claim 5, wherein the one or moreplacement criteria are based at least in part on a cost metricassociated with use of the physical GPU by the physical computeinstance.
 9. The method as recited in claim 5, wherein the one or moreplacement criteria are based at least in part on an energy metricassociated with use of the physical GPU by the physical computeinstance.
 10. The method as recited in claim 5, wherein the GPU locationor the instance location is selected based at least in part on networklocality.
 11. The method as recited in claim 5, wherein the GPU locationis selected based at least in part on network latency between thephysical GPU and a client device.
 12. The method as recited in claim 5,wherein provisioning the virtual compute instance and the virtual GPUcomprises: migrating the virtual compute instance from an existingphysical compute instance in an existing instance location to thephysical compute instance in the instance location; or migrating thevirtual GPU from an existing physical GPU instance in an existing GPUlocation to the physical GPU in the GPU location.
 13. Acomputer-readable storage medium storing program instructionscomputer-executable to perform: selecting, in a multi-tenant providernetwork, a graphics processing unit (GPU) location for a physical GPUand an instance location for a physical compute instance based at leastin part on one or more placement criteria, wherein the multi-tenantprovider network comprises a plurality of instance locations forphysical compute instances and a plurality of GPU locations for physicalGPUs; and provisioning a virtual compute instance and a virtual GPUattached to the virtual compute instance, wherein the virtual computeinstance is implemented using the physical compute instance in theinstance location, wherein the virtual GPU is implemented using thephysical GPU in the GPU location, and wherein the physical GPU isaccessible to the physical compute instance over a network.
 14. Thecomputer-readable storage medium as recited in claim 13, wherein the oneor more placement criteria are based at least in part on one or moremetrics.
 15. The computer-readable storage medium as recited in claim13, wherein the one or more placement criteria are based at least inpart on a performance metric associated with use of the physical GPU bythe physical compute instance.
 16. The computer-readable storage mediumas recited in claim 13, wherein the one or more placement criteria arebased at least in part on a cost metric associated with use of thephysical GPU by the physical compute instance.
 17. The computer-readablestorage medium as recited in claim 13, wherein the one or more placementcriteria are based at least in part on an energy metric associated withuse of the physical GPU by the physical compute instance.
 18. Thecomputer-readable storage medium as recited in claim 13, wherein the GPUlocation and the instance location are selected based at least in parton network locality.
 19. The computer-readable storage medium as recitedin claim 13, wherein the GPU location is selected based at least in parton network latency between the physical GPU and a client device.
 20. Thecomputer-readable storage medium as recited in claim 13, whereinprovisioning the virtual compute instance and the virtual GPU comprises:migrating the virtual compute instance from an existing physical computeinstance in an existing instance location to the physical computeinstance in the instance location; or migrating the virtual GPU from anexisting physical GPU instance in an existing GPU location to thephysical GPU in the GPU location.